diff options
author | Roland McGrath <roland@gnu.org> | 1996-01-26 10:00:23 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-01-26 10:00:23 +0000 |
commit | 8dad333dcef9dc1116277b98987a42a1b38f74ea (patch) | |
tree | 3ab6e85baf710c75bc79f75e9fb9fd1f759ab968 /stdlib/strtol.c | |
parent | ebc53fbed04ed9162f4ecdcf0d3d5ab3e7e5de54 (diff) | |
download | glibc-8dad333dcef9dc1116277b98987a42a1b38f74ea.zip glibc-8dad333dcef9dc1116277b98987a42a1b38f74ea.tar.gz glibc-8dad333dcef9dc1116277b98987a42a1b38f74ea.tar.bz2 |
Thu Jan 25 18:58:25 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>cvs/libc-960126
* stdlib/strtol.c [UNSIGNED]: Don't recognize + or - as sign.
Diffstat (limited to 'stdlib/strtol.c')
-rw-r--r-- | stdlib/strtol.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/stdlib/strtol.c b/stdlib/strtol.c index b06063c..2996603 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; |