diff --git a/lib/libc/stdlib/strtoq.c b/lib/libc/stdlib/strtoq.c index 2c6c65b51506..0532f9f228c6 100644 --- a/lib/libc/stdlib/strtoq.c +++ b/lib/libc/stdlib/strtoq.c @@ -56,7 +56,7 @@ strtoq(nptr, endptr, base) { register const char *s; register quad_t acc, cutoff; - register unsigned int c; + register int c; register int neg, any, cutlim; /* @@ -66,7 +66,7 @@ strtoq(nptr, endptr, base) */ s = nptr; do { - c = *s++; + c = (unsigned char) *s++; } while (isspace(c)); if (c == '-') { neg = 1; @@ -113,7 +113,7 @@ strtoq(nptr, endptr, base) } cutlim = -cutlim; } - for (acc = 0, any = 0;; c = *s++) { + for (acc = 0, any = 0;; c = (unsigned char) *s++) { if (isdigit(c)) c -= '0'; else if (isalpha(c)) diff --git a/lib/libc/stdlib/strtouq.c b/lib/libc/stdlib/strtouq.c index 4fae6f40af7e..b872cf56f752 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; register u_quad_t acc, cutoff; - register unsigned int c; + register int c; register int neg, any, cutlim; /* @@ -64,7 +64,7 @@ strtouq(nptr, endptr, base) */ s = nptr; do { - c = *s++; + c = (unsigned char) *s++; } while (isspace(c)); if (c == '-') { neg = 1; @@ -85,7 +85,7 @@ strtouq(nptr, endptr, base) cutoff = UQUAD_MAX / (u_quad_t)base; cutlim = UQUAD_MAX % (u_quad_t)base; - for (acc = 0, any = 0;; c = *s++) { + for (acc = 0, any = 0;; c = (unsigned char) *s++) { if (isdigit(c)) c -= '0'; else if (isalpha(c))