From f4c9be3243403d728030bb01603f41e6f5c061bc Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Sat, 27 Jul 1996 10:45:26 +0000 Subject: be very careful in case of signed chars --- src/lib/libc/stdlib/strtol.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libc/stdlib/strtol.c') diff --git a/src/lib/libc/stdlib/strtol.c b/src/lib/libc/stdlib/strtol.c index 021fdc0d2a..6ca9e553b2 100644 --- a/src/lib/libc/stdlib/strtol.c +++ b/src/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 @@ -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)) -- cgit v1.2.3-55-g6feb