]> git.bitcoin.ninja Git - tunudptotcp/commitdiff
Correct char signdness in hex conversion
authorMatt Corallo <git@bluematt.me>
Tue, 15 Mar 2022 02:58:29 +0000 (02:58 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 15 Mar 2022 02:58:29 +0000 (02:58 +0000)
main.cpp

index 1bc49909ce3f009fd86b39161bd3b53c3342299d..2afcf4c96e5b28efd6368695fd16b1a658586cec 100644 (file)
--- 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--;