summaryrefslogtreecommitdiff
path: root/libiberty/strtod.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2000-12-08 16:37:01 +0000
committerDJ Delorie <dj@redhat.com>2000-12-08 16:37:01 +0000
commitac424eb32cfa4618d9c3b58276e950e2cc58c540 (patch)
treece31655983ddde8e1e5bee9ddc4b332540e586bb /libiberty/strtod.c
parent39cd2525463aab63af6a9b111a01fb2b37e1733a (diff)
downloadbinutils-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/strtod.c')
-rw-r--r--libiberty/strtod.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libiberty/strtod.c b/libiberty/strtod.c
index c86c73de9b3..b1243acb6b3 100644
--- a/libiberty/strtod.c
+++ b/libiberty/strtod.c
@@ -22,7 +22,7 @@ the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
-#include <ctype.h>
+#include "safe-ctype.h"
extern double atof ();
@@ -42,7 +42,7 @@ strtod (str, ptr)
p = str;
- while (isspace (*p))
+ while (ISSPACE (*p))
++p;
if (*p == '+' || *p == '-')
@@ -88,10 +88,10 @@ strtod (str, ptr)
}
/* digits, with 0 or 1 periods in it. */
- if (isdigit (*p) || *p == '.')
+ if (ISDIGIT (*p) || *p == '.')
{
int got_dot = 0;
- while (isdigit (*p) || (!got_dot && *p == '.'))
+ while (ISDIGIT (*p) || (!got_dot && *p == '.'))
{
if (*p == '.')
got_dot = 1;
@@ -105,9 +105,9 @@ strtod (str, ptr)
i = 1;
if (p[i] == '+' || p[i] == '-')
++i;
- if (isdigit (p[i]))
+ if (ISDIGIT (p[i]))
{
- while (isdigit (p[i]))
+ while (ISDIGIT (p[i]))
++i;
*ptr = p + i;
return atof (str);