From 0548e292bd978f210f0f235daf02b3ab3d37c85c Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 1 Aug 1995 22:04:57 +0000 Subject: Similar changes like in strtol, all this family is VERY broken in 8bit environment (isalpha at the end of digits) --- lib/libc/stdlib/strtouq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libc/stdlib/strtouq.c') diff --git a/lib/libc/stdlib/strtouq.c b/lib/libc/stdlib/strtouq.c index ee1e13b..16dda0b 100644 --- a/lib/libc/stdlib/strtouq.c +++ b/lib/libc/stdlib/strtouq.c @@ -56,7 +56,7 @@ strtouq(nptr, endptr, base) { register const char *s = nptr; register u_quad_t acc; - register int c; + register unsigned char c; register u_quad_t qbase, cutoff; register int neg, any, cutlim; @@ -87,6 +87,8 @@ strtouq(nptr, endptr, base) cutoff = (u_quad_t)UQUAD_MAX / qbase; cutlim = (u_quad_t)UQUAD_MAX % qbase; for (acc = 0, any = 0;; c = *s++) { + if (!isascii(c)) + break; if (isdigit(c)) c -= '0'; else if (isalpha(c)) -- cgit v1.1