From 8dad333dcef9dc1116277b98987a42a1b38f74ea Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 26 Jan 1996 10:00:23 +0000 Subject: Thu Jan 25 18:58:25 1996 Roland McGrath * stdlib/strtol.c [UNSIGNED]: Don't recognize + or - as sign. --- ChangeLog | 4 ++++ stdlib/strtol.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 35befcacad..a1c7d6b327 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Jan 25 18:58:25 1996 Roland McGrath + + * stdlib/strtol.c [UNSIGNED]: Don't recognize + or - as sign. + Wed Jan 24 03:22:07 1996 Roland McGrath * malloc/mcheck.c (mabort): Declare prototype. diff --git a/stdlib/strtol.c b/stdlib/strtol.c index b06063c2c5..2996603f95 100644 --- a/stdlib/strtol.c +++ b/stdlib/strtol.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -112,7 +112,11 @@ INTERNAL (strtol) (nptr, endptr, base, group) int base; int group; { +#if UNSIGNED +#define negative 0 +#else int negative; +#endif register unsigned LONG int cutoff; register unsigned int cutlim; register unsigned LONG int i; @@ -158,6 +162,7 @@ INTERNAL (strtol) (nptr, endptr, base, group) if (*s == '\0') goto noconv; +#if !UNSIGNED /* Check for a sign. */ if (*s == '-') { @@ -171,6 +176,7 @@ INTERNAL (strtol) (nptr, endptr, base, group) } else negative = 0; +#endif if (base == 16 && s[0] == '0' && toupper (s[1]) == 'X') s += 2; -- cgit 1.4.1