From: Felix Fietkau Date: Sat, 22 Mar 2014 17:21:01 +0000 (+0100) Subject: check for length > 0 before calling ustream_write X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6ee437e845ad57a8f86dc4f3fbbaddfd487de059;p=project%2Fuclient.git check for length > 0 before calling ustream_write Signed-off-by: Felix Fietkau --- diff --git a/uclient-http.c b/uclient-http.c index c3d1d5a..c344513 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -741,7 +741,8 @@ uclient_http_send_data(struct uclient *cl, char *buf, unsigned int len) uclient_http_send_headers(uh); ustream_printf(uh->us, "%X\r\n", len); - ustream_write(uh->us, buf, len, false); + if (len > 0) + ustream_write(uh->us, buf, len, false); ustream_printf(uh->us, "\r\n"); return len;