This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
don't check for errno after Atof() (atof() doesn't set errno, and
[perl5.git] / toke.c
diff --git a/toke.c b/toke.c
index 8177476..dcb4454 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -6983,9 +6983,9 @@ Perl_scan_num(pTHX_ char *start)
            UV uv;
            errno = 0;
            if (*PL_tokenbuf == '-')
-               iv = Atol(PL_tokenbuf);
+               iv = Strtol(PL_tokenbuf, (char**)NULL, 10);
            else
-               uv = Atoul(PL_tokenbuf);
+               uv = Strtoul(PL_tokenbuf, (char**)NULL, 10);
            if (errno)
                floatit = TRUE; /* probably just too large */
            else if (*PL_tokenbuf == '-')
@@ -6994,14 +6994,9 @@ Perl_scan_num(pTHX_ char *start)
                sv_setuv(sv, uv);
        }
        if (floatit) {
-           char *tp;
-           errno = 0;
            value = Atof(PL_tokenbuf);
-           if (errno)
-               Perl_die(aTHX_ "unparseable float");
-           else
-               sv_setnv(sv, value);
-       } 
+           sv_setnv(sv, value);
+       }
 #endif
        if ( floatit ? (PL_hints & HINT_NEW_FLOAT) :
                       (PL_hints & HINT_NEW_INTEGER) )