From d98105b91b7ef63adf56fe808c92657fea927c59 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Tue, 15 Dec 2020 22:09:00 +0300 Subject: Fixed compiler warning --- src/microhttpd/response.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/microhttpd/response.c') diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index f4dc361c..a77dbe27 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c @@ -546,9 +546,17 @@ pipe_reader (void *cls, ssize_t n; (void) pos; +#ifndef _WIN32 + if (SSIZE_MAX < max) + max = SSIZE_MAX; +#else /* _WIN32 */ + if (UINT_MAX < max) + max = UINT_MAX; +#endif /* _WIN32 */ + n = read (response->fd, buf, - max); + (MHD_SCKT_SEND_SIZE_) max); if (0 == n) return MHD_CONTENT_READER_END_OF_STREAM; if (n < 0) -- cgit v1.2.3