[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] branch master updated (889b74b6 -> 4153c1cd)
From: |
gnunet |
Subject: |
[libmicrohttpd] branch master updated (889b74b6 -> 4153c1cd) |
Date: |
Tue, 27 Sep 2022 19:47:52 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a change to branch master
in repository libmicrohttpd.
from 889b74b6 connection.c: removed unused check for chunked replies
new 3cd82965 mhd_str: fixed compiler warning for compact code
new 4153c1cd mhd_str: minor refactoring for compact code
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/microhttpd/mhd_str.c | 13 +++++++------
src/microhttpd/mhd_str.h | 2 +-
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index 6099f93c..9c1c5172 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -1164,16 +1164,12 @@ MHD_str_to_uvalue_n_ (const char *str,
void *out_val,
size_t val_size,
uint64_t max_val,
- int base)
+ unsigned int base)
{
size_t i;
uint64_t res;
- int digit;
const uint64_t max_v_div_b = max_val / base;
const uint64_t max_v_mod_b = max_val % base;
- /* 'digit->value' must be function, not macro */
- int (*const dfunc)(char) = (base == 16) ?
- toxdigitvalue : todigitvalue;
if (! str || ! out_val ||
((base != 16) && (base != 10)) )
@@ -1181,8 +1177,13 @@ MHD_str_to_uvalue_n_ (const char *str,
res = 0;
i = 0;
- while (maxlen > i && 0 <= (digit = dfunc (str[i])))
+ while (maxlen > i)
{
+ const int digit = (base == 16) ?
+ toxdigitvalue (str[i]) : todigitvalue (str[i]);
+
+ if (0 > digit)
+ break;
if ( ((max_v_div_b) < res) ||
(( (max_v_div_b) == res) && ( (max_v_mod_b) < (uint64_t) digit) ) )
return 0;
diff --git a/src/microhttpd/mhd_str.h b/src/microhttpd/mhd_str.h
index cd0af55f..e2964406 100644
--- a/src/microhttpd/mhd_str.h
+++ b/src/microhttpd/mhd_str.h
@@ -351,7 +351,7 @@ MHD_str_to_uvalue_n_ (const char *str,
void *out_val,
size_t val_size,
uint64_t max_val,
- int base);
+ unsigned int base);
#define MHD_str_to_uint64_(s,ov) MHD_str_to_uvalue_n_ ((s),SIZE_MAX,(ov), \
sizeof(uint64_t), \
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (889b74b6 -> 4153c1cd),
gnunet <=