aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-07-15 12:39:47 -0400
committerNick Mathewson <nickm@torproject.org>2013-07-15 12:40:07 -0400
commit18136afbbb4934c1104716a29a0efc68a8fd8f51 (patch)
treea42473a5feb14caaf2c8a266f75ccb36fd9011f8 /src
parent22977b7c1dd6b693237fb3fed1cd6f88ec71cb21 (diff)
downloadtor-18136afbbb4934c1104716a29a0efc68a8fd8f51.tar
tor-18136afbbb4934c1104716a29a0efc68a8fd8f51.tar.gz
HEX_ERRNO_SIZE is no longer the correct upper limit for format_hex_number_sigsafe
Diffstat (limited to 'src')
-rw-r--r--src/test/test_util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c
index d5ce1eb77..4880b73a5 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2634,7 +2634,7 @@ static void
test_util_format_hex_number(void *ptr)
{
int i, len;
- char buf[HEX_ERRNO_SIZE + 1];
+ char buf[33];
const struct {
const char *str;
unsigned int x;
@@ -2643,6 +2643,7 @@ test_util_format_hex_number(void *ptr)
{"1", 1},
{"273A", 0x273a},
{"FFFF", 0xffff},
+
#if UINT_MAX >= 0xffffffff
{"31BC421D", 0x31bc421d},
{"FFFFFFFF", 0xffffffff},
@@ -2653,7 +2654,7 @@ test_util_format_hex_number(void *ptr)
(void)ptr;
for (i = 0; test_data[i].str != NULL; ++i) {
- len = format_hex_number_sigsafe(test_data[i].x, buf, HEX_ERRNO_SIZE);
+ len = format_hex_number_sigsafe(test_data[i].x, buf, 32);
test_neq(len, 0);
buf[len] = '\0';
test_streq(buf, test_data[i].str);