commit 7eb3139e9a65cc666a976b7eb811dd9fcb7f5099
parent 74ccb7ae9db4b2c978c377d4af2b5448ff8a4f26
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Mon, 5 Oct 2020 22:05:03 +0300
memorypool: added sanity checks
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c
@@ -65,9 +65,9 @@
#define ROUND_TO_ALIGN(n) (((n) + (ALIGN_SIZE - 1)) \
/ (ALIGN_SIZE) *(ALIGN_SIZE))
-#if defined(PAGE_SIZE)
+#if defined(PAGE_SIZE) && (0 < (PAGE_SIZE + 0))
#define MHD_DEF_PAGE_SIZE_ PAGE_SIZE
-#elif defined(PAGESIZE)
+#elif defined(PAGESIZE) && (0 < (PAGESIZE + 0))
#define MHD_DEF_PAGE_SIZE_ PAGESIZE
#else /* ! PAGESIZE */
#define MHD_DEF_PAGE_SIZE_ (4096)