From 23d2f670808933aa20448194b2a4ff26386d7905 Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Thu, 14 Aug 2025 21:34:19 +0200 Subject: tree_based_check: switch to unsigned values --- include/hex_conversion.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/hex_conversion.h') diff --git a/include/hex_conversion.h b/include/hex_conversion.h index 4b97d6d..e232b8e 100644 --- a/include/hex_conversion.h +++ b/include/hex_conversion.h @@ -15,9 +15,9 @@ #define ishex_macro(c) ((c>='0' && c <= '9') || (c>='A' && c <= 'F') || (c>='a' && c <= 'f')) int convert_line(char *s); -int ishex(char c); -char *convert_to_binary(char *hex, char *out); -char *convert_from_binary(char *bin, size_t l, char *out); +int ishex(unsigned char c); +unsigned char *convert_to_binary(char *hex, unsigned char *out); +char *convert_from_binary(unsigned char *bin, size_t l, char *out); /* short inline functions are fine in header */ inline int convert_line(char *s) { @@ -35,14 +35,14 @@ inline int convert_line(char *s) { return 0; } -inline int ishex(char c) { +inline int ishex(unsigned char c) { if ((c>='0' && c <= '9') || (c>='A' && c <= 'F') || (c>='a' && c <= 'f')) { return 1; } return 0; }; -inline char *convert_to_binary(char *hex, char *out) { +inline unsigned char *convert_to_binary(char *hex, unsigned char *out) { char tmp[3] = {0,0,0}; size_t length, i; if (hex == NULL) return NULL; @@ -65,14 +65,14 @@ inline char *convert_to_binary(char *hex, char *out) { for (i=0;i