add odd numbers for hex_decode

This commit is contained in:
2024-03-28 18:32:59 -07:00
parent cf6d3ce892
commit c795f607ef
2 changed files with 16 additions and 1 deletions

View File

@ -335,6 +335,16 @@ void test_crypto() {
assert(s[i] == h[i]);
}
free(s);
// Odd number of characters
s = hex_decode("f00f5", &s_sz);
unsigned char h2[4] = {
0x0F, 0x00, 0xF5
};
for (size_t i = 0; i < 3; ++i) {
assert(s[i] == h2[i]);
}
free(s);
}
#if defined(__APPLE__) || defined(__MACH__)