summaryrefslogtreecommitdiff
path: root/big.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2022-03-28 15:24:26 -0400
committerJakob Kaivo <jkk@ung.org>2022-03-28 15:24:26 -0400
commite80678e089a45578b712de9ad64cc13044a3f3e4 (patch)
tree4fe2c3065785c94259a09dbeef619c1603db238f /big.c
parentec06b597a919df4c6f7896d61ee7decd746c4e36 (diff)
modernize digitval()
Diffstat (limited to 'big.c')
-rw-r--r--big.c6
1 files changed, 3 insertions, 3 deletions
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 */