summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/strtouq.c
diff options
context:
space:
mode:
authorderaadt <>1996-07-27 10:45:26 +0000
committerderaadt <>1996-07-27 10:45:26 +0000
commitf4c9be3243403d728030bb01603f41e6f5c061bc (patch)
tree65bdb513fc1b9b5db4b407c783d2eaa4911d0c96 /src/lib/libc/stdlib/strtouq.c
parent790e572a83b827ace1ed6ee87a9614e24af34d85 (diff)
downloadopenbsd-f4c9be3243403d728030bb01603f41e6f5c061bc.tar.gz
openbsd-f4c9be3243403d728030bb01603f41e6f5c061bc.tar.bz2
openbsd-f4c9be3243403d728030bb01603f41e6f5c061bc.zip
be very careful in case of signed chars
Diffstat (limited to 'src/lib/libc/stdlib/strtouq.c')
-rw-r--r--src/lib/libc/stdlib/strtouq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/strtouq.c b/src/lib/libc/stdlib/strtouq.c
index 3ab2c232dd..b872cf56f7 100644
--- a/src/lib/libc/stdlib/strtouq.c
+++ b/src/lib/libc/stdlib/strtouq.c
@@ -64,7 +64,7 @@ strtouq(nptr, endptr, base)
64 */ 64 */
65 s = nptr; 65 s = nptr;
66 do { 66 do {
67 c = *s++; 67 c = (unsigned char) *s++;
68 } while (isspace(c)); 68 } while (isspace(c));
69 if (c == '-') { 69 if (c == '-') {
70 neg = 1; 70 neg = 1;
@@ -85,7 +85,7 @@ strtouq(nptr, endptr, base)
85 85
86 cutoff = UQUAD_MAX / (u_quad_t)base; 86 cutoff = UQUAD_MAX / (u_quad_t)base;
87 cutlim = UQUAD_MAX % (u_quad_t)base; 87 cutlim = UQUAD_MAX % (u_quad_t)base;
88 for (acc = 0, any = 0;; c = *s++) { 88 for (acc = 0, any = 0;; c = (unsigned char) *s++) {
89 if (isdigit(c)) 89 if (isdigit(c))
90 c -= '0'; 90 c -= '0';
91 else if (isalpha(c)) 91 else if (isalpha(c))