summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-04-12 14:36:09 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-04-12 14:36:09 +0000
commit36d82b1a0d34dc1b436abeeae9984b101718086c (patch)
tree52d83e5a05e8db0b52c5839ff4e072a5ab1998ac
parent665fd0c24a06d0e9798d3593523cd314e2242bfd (diff)
connection.c: used internal US-ASCII-only hex string -> value conversion
-rw-r--r--src/microhttpd/connection.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index e6b367a8..d9ba4807 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1644,7 +1644,6 @@ process_request_body (struct MHD_Connection *connection)
int instant_retry;
int malformed;
char *buffer_head;
- char *end;
if (NULL != connection->response)
return; /* already queued a response */
@@ -1715,9 +1714,9 @@ process_request_body (struct MHD_Connection *connection)
malformed = (i >= 6);
if (!malformed)
{
- buffer_head[i] = '\0';
- connection->current_chunk_size = strtoul (buffer_head, &end, 16);
- malformed = ('\0' != *end);
+ size_t num_dig = MHD_strx_to_sizet_n_ (buffer_head, i,
+ &connection->current_chunk_size);
+ malformed = (i != num_dig);
}
if (malformed)
{