tests: utils_test: Fix test failure when compiling with -O0

It seems with default flags in_buf was being memzeroed by the compiler.
When compiling with -O0, that's not the case anymore and printf prints
after first 16 bytes, printing extra garbage which doesn't match the
expected output.

Change-Id: I736c1e4d625f647d3bb794fa717256e9dbf36e87
This commit is contained in:
Pau Espin 2018-02-01 12:49:39 +01:00 committed by Harald Welte
parent 41911d0380
commit 6de34ee46b
1 changed files with 1 additions and 0 deletions

View File

@ -334,6 +334,7 @@ static void str_escape_test(void)
printf("\nTesting string escaping\n");
printf("- all chars from 0 to 255 in batches of 16:\n");
in_buf[16] = '\0';
for (j = 0; j < 16; j++) {
for (i = 0; i < 16; i++)
in_buf[i] = (j << 4) | i;