diff options
author | DJ Delorie <dj@redhat.com> | 2000-12-08 16:37:01 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2000-12-08 16:37:01 +0000 |
commit | ac424eb32cfa4618d9c3b58276e950e2cc58c540 (patch) | |
tree | ce31655983ddde8e1e5bee9ddc4b332540e586bb /libiberty/strtoul.c | |
parent | 39cd2525463aab63af6a9b111a01fb2b37e1733a (diff) | |
download | binutils-gdb-ac424eb32cfa4618d9c3b58276e950e2cc58c540.tar.gz |
* safe-ctype.c: New file.
* Makefile.in (CFILES): Add safe-ctype.c.
(REQUIRED_OFILES): Add safe-ctype.o.
* argv.c: Define ISBLANK and use it, not isspace.
* basename.c, cplus-dem.c, fnmatch.c, pexecute.c, strtod.c,
strtol.c, strtoul.c: Include safe-ctype.h, not ctype.h. Use
uppercase ctype macros. Don't test ISUPPER(c)/ISLOWER(c)
before calling TOLOWER(c)/TOUPPER(c).
Diffstat (limited to 'libiberty/strtoul.c')
-rw-r--r-- | libiberty/strtoul.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libiberty/strtoul.c b/libiberty/strtoul.c index 87fa3ffdf93..ce969339bc2 100644 --- a/libiberty/strtoul.c +++ b/libiberty/strtoul.c @@ -74,7 +74,7 @@ strtoul(nptr, endptr, base) */ do { c = *s++; - } while (isspace(c)); + } while (ISSPACE(c)); if (c == '-') { neg = 1; c = *s++; @@ -91,10 +91,10 @@ strtoul(nptr, endptr, base) cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; for (acc = 0, any = 0;; c = *s++) { - if (isdigit(c)) + if (ISDIGIT(c)) c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else if (ISALPHA(c)) + c -= ISUPPER(c) ? 'A' - 10 : 'a' - 10; else break; if (c >= base) |