mirror of https://github.com/ericonr/sndio.git
dont write past buffer end, ok armani@
This commit is contained in:
parent
bf045ccb03
commit
6fa4f57d50
|
@ -612,7 +612,7 @@ sock_wdata(struct sock *f)
|
||||||
data = abuf_rgetblk(buf, &count);
|
data = abuf_rgetblk(buf, &count);
|
||||||
if (count > f->wtodo)
|
if (count > f->wtodo)
|
||||||
count = f->wtodo;
|
count = f->wtodo;
|
||||||
n = sock_fdwrite(f, data, f->wtodo);
|
n = sock_fdwrite(f, data, count);
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return 0;
|
return 0;
|
||||||
f->wtodo -= n;
|
f->wtodo -= n;
|
||||||
|
|
Loading…
Reference in New Issue