From 1f4aec43d9256f76c79f789234fed8325eaacf08 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Mon, 13 Mar 2017 11:02:46 +0100 Subject: [PATCH] toread is unsigned, it won't ever fall < 0. --- src/http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/http.c b/src/http.c index d62e78e..5caa193 100644 --- a/src/http.c +++ b/src/http.c @@ -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) {