diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-03-28 15:24:26 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-03-28 15:24:26 -0400 |
commit | e80678e089a45578b712de9ad64cc13044a3f3e4 (patch) | |
tree | 4fe2c3065785c94259a09dbeef619c1603db238f | |
parent | ec06b597a919df4c6f7896d61ee7decd746c4e36 (diff) |
modernize digitval()
-rw-r--r-- | big.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 */ |