diff options
| author | 1996-07-27 10:45:23 +0000 | |
|---|---|---|
| committer | 1996-07-27 10:45:23 +0000 | |
| commit | 66ce1e86df35ce74f4af8525b6ce95e6d4692c96 (patch) | |
| tree | baad9569f607c7c250bae9dde71901ba76204e19 /lib/libc/stdlib/strtoq.c | |
| parent | fix from bde; Clean up the FP stack before returning. The i387 exp() (diff) | |
| download | wireguard-openbsd-66ce1e86df35ce74f4af8525b6ce95e6d4692c96.tar.xz wireguard-openbsd-66ce1e86df35ce74f4af8525b6ce95e6d4692c96.zip | |
be very careful in case of signed chars
Diffstat (limited to 'lib/libc/stdlib/strtoq.c')
| -rw-r--r-- | lib/libc/stdlib/strtoq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/strtoq.c b/lib/libc/stdlib/strtoq.c index 003c020d719..0532f9f228c 100644 --- a/lib/libc/stdlib/strtoq.c +++ b/lib/libc/stdlib/strtoq.c @@ -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)) |
