From: Fredrik Tolf Date: Tue, 26 Apr 2016 03:21:33 +0000 (+0200) Subject: lib: Fixed some bufio bugs. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=029ce99be56734bb1a381766e7b5b7a1c40e9ecc;p=ashd.git lib: Fixed some bufio bugs. --- diff --git a/lib/bufio.c b/lib/bufio.c index 4f2ad10..83963b3 100644 --- a/lib/bufio.c +++ b/lib/bufio.c @@ -228,6 +228,7 @@ ssize_t biowrite(struct bufio *bio, const void *data, size_t len) } if(len < bio->wbuf.s - bio->wbuf.d) { memcpy(bio->wbuf.b + bio->wbuf.d, data, len); + bio->wbuf.d += len; wb += len; len = 0; } else { @@ -247,7 +248,7 @@ ssize_t biowrite(struct bufio *bio, const void *data, size_t len) data += ret; len -= ret; wb += ret; } } - return(0); + return(wb); } ssize_t biowritesome(struct bufio *bio, const void *data, size_t len)