summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/libiberty/strtod.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-05-28 05:21:37 +0000
committerobrien <obrien@FreeBSD.org>2001-05-28 05:21:37 +0000
commit328e45595b12375b6d16a846069507d25086abdb (patch)
treeae2a6f4f4987889b7bd2af7bdf0b86fa580df011 /contrib/binutils/libiberty/strtod.c
parent7fbb72605a1c3bcb81f8b6bb6297ffef30f84335 (diff)
downloadFreeBSD-src-328e45595b12375b6d16a846069507d25086abdb.zip
FreeBSD-src-328e45595b12375b6d16a846069507d25086abdb.tar.gz
Import of GNU Binutils version 2.11.0.
Believe it or not, this is heavily stripped down.
Diffstat (limited to 'contrib/binutils/libiberty/strtod.c')
-rw-r--r--contrib/binutils/libiberty/strtod.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/binutils/libiberty/strtod.c b/contrib/binutils/libiberty/strtod.c
index c86c73d..90292c2 100644
--- a/contrib/binutils/libiberty/strtod.c
+++ b/contrib/binutils/libiberty/strtod.c
@@ -22,7 +22,8 @@ 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 "ansidecl.h"
+#include "safe-ctype.h"
extern double atof ();
@@ -42,7 +43,7 @@ strtod (str, ptr)
p = str;
- while (isspace (*p))
+ while (ISSPACE (*p))
++p;
if (*p == '+' || *p == '-')
@@ -88,10 +89,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 +106,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);
OpenPOWER on IntegriCloud