diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-07-27 10:45:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-07-27 10:45:27 +0000 |
commit | 5bea288f6608e242c7d157ce28a6859bb37d6e20 (patch) | |
tree | 244c7c4c0538b71133b44fce185b1853b28d0834 /lib/libc/stdlib/strtouq.c | |
parent | 5507d8e1c590b85bc9d7a51585295d6a2284f9fd (diff) |
be very careful in case of signed chars
Diffstat (limited to 'lib/libc/stdlib/strtouq.c')
-rw-r--r-- | lib/libc/stdlib/strtouq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/strtouq.c b/lib/libc/stdlib/strtouq.c index 3ab2c232ddd..b872cf56f75 100644 --- a/lib/libc/stdlib/strtouq.c +++ b/lib/libc/stdlib/strtouq.c @@ -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)) |