From 9ef039777b0f9bca6ab147360d3f7e8c686bbe2b Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 27 Oct 2010 19:06:10 +0000 Subject: 2010-10-27 Maurice Baijens * libc/stdlib/strtol.c: Make sure signed characters are not sign-extended when converted to int and passed to ctype macros. * libc/stdlib/strtoul.c: Ditto. * libc/stdlib/strtoll_r.c: Ditto. * libc/stdlib/strtoull_r.c: Ditto. --- newlib/libc/stdlib/strtol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'newlib/libc/stdlib/strtol.c') diff --git a/newlib/libc/stdlib/strtol.c b/newlib/libc/stdlib/strtol.c index 4c07e6171..4fcce958f 100644 --- a/newlib/libc/stdlib/strtol.c +++ b/newlib/libc/stdlib/strtol.c @@ -137,7 +137,7 @@ _DEFUN (_strtol_r, (rptr, nptr, endptr, base), char **endptr _AND int base) { - register const char *s = nptr; + register const unsigned char *s = (const unsigned char *)nptr; register unsigned long acc; register int c; register unsigned long cutoff; @@ -208,7 +208,7 @@ _DEFUN (_strtol_r, (rptr, nptr, endptr, base), } else if (neg) acc = -acc; if (endptr != 0) - *endptr = (char *) (any ? s - 1 : nptr); + *endptr = (char *) (any ? (char *)s - 1 : nptr); return (acc); } -- cgit v1.2.3