From: Matt Corallo Date: Tue, 15 Mar 2022 02:58:29 +0000 (+0000) Subject: Correct char signdness in hex conversion X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=61466702c301dada4eb85bd296e30a7d7a383f19;p=tunudptotcp Correct char signdness in hex conversion --- diff --git a/main.cpp b/main.cpp index 1bc4990..2afcf4c 100644 --- a/main.cpp +++ b/main.cpp @@ -236,8 +236,8 @@ const signed char p_util_hexdigit[256] = -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, }; -uint32_t hex_to_num(const char* buf) { - const char* pbegin = buf; +uint32_t hex_to_num(const unsigned char* buf) { + const unsigned char* pbegin = buf; while (p_util_hexdigit[*buf] != -1) buf++; buf--;