commit 4f494d00b721593f00fda7297f63964c96ca3b21
parent e3673e4fd7a2cfc799a999b0a595284202d2e4bb
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Tue, 30 Jan 2024 20:49:09 +0100
Fixed compiler warnings
Diffstat:
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/examples/demo.c b/src/examples/demo.c
@@ -793,8 +793,8 @@ generate_page (void *cls,
/* read beginning of the file to determine mime type */
got = read (fd, file_data, sizeof (file_data));
(void) lseek (fd, 0, SEEK_SET);
- if (-1 != got)
- mime = magic_buffer (magic, file_data, got);
+ if (0 < got)
+ mime = magic_buffer (magic, file_data, (size_t) got);
else
#endif /* MHD_HAVE_LIBMAGIC */
mime = NULL;
@@ -1002,7 +1002,8 @@ main (int argc, char *const *argv)
MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) (64),
#endif
MHD_OPTION_CONNECTION_TIMEOUT, (unsigned
- int) (120 /* seconds */),
+ int) (120 /* seconds */)
+ ,
MHD_OPTION_THREAD_POOL_SIZE, (unsigned
int) NUMBER_OF_THREADS,
MHD_OPTION_NOTIFY_COMPLETED,
diff --git a/src/examples/demo_https.c b/src/examples/demo_https.c
@@ -794,8 +794,8 @@ generate_page (void *cls,
/* read beginning of the file to determine mime type */
got = read (fd, file_data, sizeof (file_data));
(void) lseek (fd, 0, SEEK_SET);
- if (-1 != got)
- mime = magic_buffer (magic, file_data, got);
+ if (0 < got)
+ mime = magic_buffer (magic, file_data, (size_t) got);
else
#endif /* MHD_HAVE_LIBMAGIC */
mime = NULL;
@@ -1046,7 +1046,8 @@ main (int argc, char *const *argv)
MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) (64),
#endif
MHD_OPTION_CONNECTION_TIMEOUT, (unsigned
- int) (120 /* seconds */),
+ int) (120 /* seconds */)
+ ,
MHD_OPTION_THREAD_POOL_SIZE, (unsigned
int) NUMBER_OF_THREADS,
MHD_OPTION_NOTIFY_COMPLETED,