diff --git a/libfetch/common.c b/libfetch/common.c index 01c5f2b..248b575 100644 --- a/libfetch/common.c +++ b/libfetch/common.c @@ -181,7 +181,7 @@ fetch_parseuint(const char *str, const char **endptr, int radix, uintmax_t max) unsigned char ch = (unsigned char)*p; if (isdigit(ch)) d = ch - '0'; - else d = tolower(ch - 'a'); + else d = tolower(ch) - 'a' + 10; if (d > radix || val > maxx) goto err; val *= radix; if (val > max-d) goto err;