diff options
author | ache <ache@FreeBSD.org> | 2001-11-28 06:06:27 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-11-28 06:06:27 +0000 |
commit | 3a5ef923430736453c2e3800277c2558c14e0f25 (patch) | |
tree | 7fda1da266f5c4d254c366b8856290fa9ad01569 /lib/libc/stdlib/strtoimax.c | |
parent | f320d6c29a634f799998ac539ecc1fc1f261e4c5 (diff) | |
download | FreeBSD-src-3a5ef923430736453c2e3800277c2558c14e0f25.zip FreeBSD-src-3a5ef923430736453c2e3800277c2558c14e0f25.tar.gz |
Don't ever assume that isdigit() is always subset of isxdigit()
Diffstat (limited to 'lib/libc/stdlib/strtoimax.c')
-rw-r--r-- | lib/libc/stdlib/strtoimax.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdlib/strtoimax.c b/lib/libc/stdlib/strtoimax.c index f8ff09b..e5e0442 100644 --- a/lib/libc/stdlib/strtoimax.c +++ b/lib/libc/stdlib/strtoimax.c @@ -112,7 +112,7 @@ strtoimax(nptr, endptr, base) cutlim = cutoff % base; cutoff /= base; for ( ; ; c = *s++) { - if (isxdigit(c)) + if (isdigit(c) || (base == 16 && isxdigit(c))) c = digittoint(c); else if (isascii(c) && isalpha(c)) c -= isupper(c) ? 'A' - 10 : 'a' - 10; |