From e80678e089a45578b712de9ad64cc13044a3f3e4 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 28 Mar 2022 15:24:26 -0400 Subject: modernize digitval() --- big.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'big.c') diff --git a/big.c b/big.c index 8a563e7..e77709c 100644 --- a/big.c +++ b/big.c @@ -809,10 +809,10 @@ word bigoscan(char *p, char *q) return r; } -word digitval(c) -char c; +/* TODO: this assumes ASCII/UTF-8 */ +word digitval(char c) { - return isdigit(c) ? c - '0' : isupper(c) ? 10 + c - 'A' : 10 + c - 'a'; + return isdigit(c) ? c - '0' : 10 + tolower(c) - 'a'; } word strtobig(z, base) /* numeral (as Miranda string) to big number */ -- cgit v1.2.1