diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 68a0ca2984..208c5c4f59 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -1212,14 +1212,13 @@ test_util_load_win_lib(void *ptr) static void clear_hex_errno(char *hex_errno) { - memset(hex_errno, ' ', HEX_ERRNO_SIZE - 2); - hex_errno[HEX_ERRNO_SIZE - 1] = '\n'; - hex_errno[HEX_ERRNO_SIZE] = '\0'; + memset(hex_errno, '\0', HEX_ERRNO_SIZE + 1); } static void test_util_exit_status(void *ptr) { + /* Leave an extra byte for a \0 so we can do string comparison */ char hex_errno[HEX_ERRNO_SIZE + 1]; (void)ptr; |