kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 1f4aec43d9256f76c79f789234fed8325eaacf08
parent 3ae9bb7ae9adf30f5dd75259f38912de64773bae
Author: Joris Vink <joris@coders.se>
Date:   Mon, 13 Mar 2017 11:02:46 +0100

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

Diffstat:
src/http.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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) {