toread is unsigned, it won't ever fall < 0.

This commit is contained in:
Joris Vink 2017-03-13 11:02:46 +01:00
parent 3ae9bb7ae9
commit 1f4aec43d9

View File

@ -974,7 +974,7 @@ http_file_read(struct http_file *file, void *buf, size_t len)
off = file->position + file->offset;
toread = MIN(len, (file->length - file->offset));
if (toread <= 0)
if (toread == 0)
return (0);
if (file->req->http_body_fd != -1) {
@ -1198,7 +1198,7 @@ http_body_read(struct http_request *req, void *out, size_t len)
size_t toread;
toread = MIN(req->http_body_length, len);
if (toread <= 0)
if (toread == 0)
return (0);
if (req->http_body_fd != -1) {