summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/strtol.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-07-27 10:45:23 +0000
committerderaadt <deraadt@openbsd.org>1996-07-27 10:45:23 +0000
commit66ce1e86df35ce74f4af8525b6ce95e6d4692c96 (patch)
treebaad9569f607c7c250bae9dde71901ba76204e19 /lib/libc/stdlib/strtol.c
parentfix from bde; Clean up the FP stack before returning. The i387 exp() (diff)
downloadwireguard-openbsd-66ce1e86df35ce74f4af8525b6ce95e6d4692c96.tar.xz
wireguard-openbsd-66ce1e86df35ce74f4af8525b6ce95e6d4692c96.zip
be very careful in case of signed chars
Diffstat (limited to 'lib/libc/stdlib/strtol.c')
-rw-r--r--lib/libc/stdlib/strtol.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c
index 021fdc0d2a4..6ca9e553b26 100644
--- a/lib/libc/stdlib/strtol.c
+++ b/lib/libc/stdlib/strtol.c
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strtol.c 5.4 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id: strtol.c,v 1.2 1995/12/21 14:58:36 deraadt Exp $";
+static char *rcsid = "$Id: strtol.c,v 1.3 1996/07/27 10:45:24 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <ctype.h>
@@ -66,7 +66,7 @@ strtol(nptr, endptr, base)
*/
s = nptr;
do {
- c = *s++;
+ c = (unsigned char) *s++;
} while (isspace(c));
if (c == '-') {
neg = 1;
@@ -112,7 +112,7 @@ strtol(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))