partial writes are successful

This commit is contained in:
Alex Shinn 2015-07-29 22:38:25 +09:00
parent 1956e38ba0
commit 3e8872dc48

4
sexp.c
View file

@ -1363,8 +1363,10 @@ int sexp_buffered_flush (sexp ctx, sexp p, int forcep) {
if (res > 0) { if (res > 0) {
memmove(sexp_port_buf(p), sexp_port_buf(p) + res, off - res); memmove(sexp_port_buf(p), sexp_port_buf(p) + res, off - res);
sexp_port_offset(p) = off - res; sexp_port_offset(p) = off - res;
} res = 0;
} else {
res = -1; res = -1;
}
} else { } else {
sexp_port_offset(p) = 0; sexp_port_offset(p) = 0;
res = 0; res = 0;