[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.
- [libmicrohttpd] branch master updated (d5993f6c -> 7131f387), gnunet, 2021/10/31
- [libmicrohttpd] 03/07: Sync doxy header and source, gnunet, 2021/10/31
- [libmicrohttpd] 07/07: memorypool: minor code improvments,
gnunet <=
- [libmicrohttpd] 05/07: memorypool: improved macros for manual poisoning, gnunet, 2021/10/31
- [libmicrohttpd] 02/07: microhttpd.h: fixed code style, gnunet, 2021/10/31
- [libmicrohttpd] 04/07: mhd_bithelpers: unified _MHD_ROTx32() behavior, gnunet, 2021/10/31
- [libmicrohttpd] 01/07: MHD_get_timeout(): improved doxy, gnunet, 2021/10/31
- [libmicrohttpd] 06/07: memorypool: fixed code style, gnunet, 2021/10/31