We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 28880ea commit c661fd4Copy full SHA for c661fd4
extras/test/src/hex/test_hex.cpp
@@ -18,11 +18,11 @@ SCENARIO( "HEX encoding test" ) {
18
for(i = 0; i <= 0xffff; ++i){
19
/* encode to hex string using our implementation */
20
const unsigned char org[2] = {(unsigned char)(i>>8), (unsigned char)i};
21
- char hex[5];
+ char hex[5] = {0,0,0,0,0};
22
chex_encode(hex, sizeof(hex), org, sizeof(org));
23
24
/* decode from hex string using a function from the standard library */
25
- unsigned char bin[2];
+ unsigned char bin[2] = {0,0};
26
int n = sscanf(hex, "%02hhx%02hhx", bin, bin+1);
27
REQUIRE(n == sizeof(bin));
28
@@ -37,7 +37,7 @@ SCENARIO( "HEX decoding test" ) {
37
unsigned i;
38
39
/* encode to hex string using a function from the standard library */
40
41
snprintf(hex, sizeof(hex), "%02hhX%02hhx", (unsigned char)(i>>8), (unsigned char)i);
42
43
/* decode from hex string using our implementation */
0 commit comments