From 61466702c301dada4eb85bd296e30a7d7a383f19 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 15 Mar 2022 02:58:29 +0000 Subject: [PATCH] Correct char signdness in hex conversion --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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--; -- 2.30.2