aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_str.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/mhd_str.c')
-rw-r--r--src/microhttpd/mhd_str.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index cf2e43c3..6099f93c 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -1382,12 +1382,25 @@ MHD_bin_to_hex (const void *bin,
1382 j = b & 0x0f; 1382 j = b & 0x0f;
1383 hex[i * 2 + 1] = (char) ((j < 10) ? (j + '0') : (j - 10 + 'a')); 1383 hex[i * 2 + 1] = (char) ((j < 10) ? (j + '0') : (j - 10 + 'a'));
1384 } 1384 }
1385 hex[i * 2] = 0;
1386 return i * 2; 1385 return i * 2;
1387} 1386}
1388 1387
1389 1388
1390size_t 1389size_t
1390MHD_bin_to_hex_z (const void *bin,
1391 size_t size,
1392 char *hex)
1393{
1394 size_t res;
1395
1396 res = MHD_bin_to_hex (bin, size, hex);
1397 hex[res] = 0;
1398
1399 return res;
1400}
1401
1402
1403size_t
1391MHD_hex_to_bin (const char *hex, 1404MHD_hex_to_bin (const char *hex,
1392 size_t len, 1405 size_t len,
1393 void *bin) 1406 void *bin)