diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-13 20:23:24 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-13 20:23:24 +0000 |
commit | 96989be3bc50b6c1465b0f1ebc67c335197c6e3e (patch) | |
tree | 5c6375ffd155ffda61591e362de9cc3f2e79f3df | |
parent | a8be16862b9dea9c8922a18387c36d2042cc8334 (diff) | |
download | perl-96989be3bc50b6c1465b0f1ebc67c335197c6e3e.tar.gz |
don't check for errno after Atof() (atof() doesn't set errno, and
where Atof() is actually strto[l]d(), some platforms seem to want
to set errno randomly)
p4raw-id: //depot/perl@5707
-rw-r--r-- | toke.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -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) ) |