gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 01/04: Fixed compiler warnings


From: gnunet
Subject: [libmicrohttpd] 01/04: Fixed compiler warnings
Date: Tue, 30 Jan 2024 23:07:08 +0100

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 4f494d00b721593f00fda7297f63964c96ca3b21
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Jan 30 20:49:09 2024 +0100

    Fixed compiler warnings
---
 src/examples/demo.c       | 7 ++++---
 src/examples/demo_https.c | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/examples/demo.c b/src/examples/demo.c
index 3134d5ed..bae63d74 100644
--- 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
index 6658408a..4b937af1 100644
--- 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,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]