gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated: memorypool: fixed bu


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated: memorypool: fixed build with VC, minor fixes
Date: Thu, 13 Jun 2019 12:05:59 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 04d8449a memorypool: fixed build with VC, minor fixes
04d8449a is described below

commit 04d8449af5d2908adce7dfae256bbc0694b8552f
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Thu Jun 13 13:04:36 2019 +0300

    memorypool: fixed build with VC, minor fixes
---
 src/microhttpd/memorypool.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c
index 20ab4908..c7541cda 100644
--- a/src/microhttpd/memorypool.c
+++ b/src/microhttpd/memorypool.c
@@ -33,7 +33,7 @@
 #include <sys/mman.h>
 #endif
 #ifdef _WIN32
-#include <memoryapi.h>
+#include <windows.h>
 #endif
 
 /* define MAP_ANONYMOUS for Mac OS X */
@@ -42,7 +42,7 @@
 #endif
 #if defined(_WIN32)
 #define MAP_FAILED NULL
-#elif ! defined(MAP_FAILED)
+#elif !defined(MAP_FAILED)
 #define MAP_FAILED ((void*)-1)
 #endif
 
@@ -126,8 +126,7 @@ MHD_pool_create (size_t max)
 #else
   pool->memory = MAP_FAILED;
 #endif
-  if ( (MAP_FAILED == pool->memory) ||
-       (NULL == pool->memory))
+  if (MAP_FAILED == pool->memory)
     {
       pool->memory = malloc (max);
       if (NULL == pool->memory)
@@ -285,7 +284,7 @@ MHD_pool_reallocate (struct MemoryPool *pool,
           pool->pos = new_apos;
           /* Zero-out unused part if shrinking */
           if (old_size > new_size)
-            memset (old + new_size, 0, old_size - new_size);
+            memset ((uint8_t*)old + new_size, 0, old_size - new_size);
           return old;
         }
     }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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