diff --git a/libpcp/util.c b/libpcp/util.c index f3e502a..11f9302 100644 --- a/libpcp/util.c +++ b/libpcp/util.c @@ -95,7 +95,7 @@ size_t _hex2bin(const char *hex_str, unsigned char *byte_array, size_t byte_arra if (byte_array_size > byte_array_max) { // Too big for the output array - return -1; + return 0; } if (hex_str_len % 2 == 1) @@ -103,7 +103,7 @@ size_t _hex2bin(const char *hex_str, unsigned char *byte_array, size_t byte_arra // hex_str is an odd length, so assume an implicit "0" prefix if (sscanf(&(hex_str[0]), "%1hhx", &(byte_array[0])) != 1) { - return -1; + return 0; } i = j = 1; @@ -113,7 +113,7 @@ size_t _hex2bin(const char *hex_str, unsigned char *byte_array, size_t byte_arra { if (sscanf(&(hex_str[i]), "%2hhx", &(byte_array[j])) != 1) { - return -1; + return 0; } }