libc: fix bad digit check for strtoul base>10

This commit is contained in:
K. Lange 2018-12-22 12:50:36 +09:00
parent 7f51afb3f2
commit 288bcc3b38

View File

@ -12,6 +12,7 @@ static int is_valid(int base, char c) {
if (c > '9' && c < 'a') return 0;
if (c > 'a' + (base - 10) && c < 'A') return 1;
if (c > 'A' + (base - 10)) return 1;
if (c >= '0' && c <= '9') return 1;
return 0;
}