gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 07/07: memorypool: minor code improvments


From: gnunet
Subject: [libmicrohttpd] 07/07: memorypool: minor code improvments
Date: Sun, 31 Oct 2021 17:02:49 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 7131f3876031fcd7a67963049edbf21b7f89ee38
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Oct 31 18:57:09 2021 +0300

    memorypool: minor code improvments
---
 src/microhttpd/memorypool.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c
index 799648d7..4eae9618 100644
--- a/src/microhttpd/memorypool.c
+++ b/src/microhttpd/memorypool.c
@@ -333,8 +333,7 @@ MHD_pool_allocate (struct MemoryPool *pool,
   asize = ROUND_TO_ALIGN_PLUS_RED_ZONE (size);
   if ( (0 == asize) && (0 != size) )
     return NULL; /* size too close to SIZE_MAX */
-  if ( (pool->pos + asize > pool->end) ||
-       (pool->pos + asize < pool->pos))
+  if (asize > pool->end - pool->pos)
     return NULL;
   if (from_end)
   {
@@ -386,8 +385,7 @@ MHD_pool_try_alloc (struct MemoryPool *pool,
     *required_bytes = SIZE_MAX;
     return NULL;
   }
-  if ( (pool->pos + asize > pool->end) ||
-       (pool->pos + asize < pool->pos))
+  if (asize > pool->end - pool->pos)
   {
     mhd_assert ((pool->end - pool->pos) == \
                 ROUND_TO_ALIGN (pool->end - pool->pos));

-- 
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]