diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2005-02-01 03:51:21 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2005-02-01 03:51:21 +0000 |
commit | d93998b17a4c7f07925ecdd48a9474864ba47aea (patch) | |
tree | bf36fc2f5759d63f8acc3c36eb27006459118afb /winsup/mingw | |
parent | d8b84e4bc4a0cd92d6c8b3269be4b409bd95c5f5 (diff) | |
download | newlib-d93998b17a4c7f07925ecdd48a9474864ba47aea.zip newlib-d93998b17a4c7f07925ecdd48a9474864ba47aea.tar.gz newlib-d93998b17a4c7f07925ecdd48a9474864ba47aea.tar.bz2 |
* mingwex/strtold.c (__asctoe64): Set endptr to 'e' if exponent
string is not valid.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/mingw/mingwex/strtold.c | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 8c10559..b4010be 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,8 @@ +2005-02-01 Danny Smith <dannysmith@users.sourceforge.net> + + * mingwex/strtold.c (__asctoe64): Set endptr to 'e' if exponent + string is not valid. + 2005-01-26 Oliver Stoeneberg <oliverst@online.de> * include/malloc.h: Add missing return code defines for diff --git a/winsup/mingw/mingwex/strtold.c b/winsup/mingw/mingwex/strtold.c index 954d3cb..3bbcea0 100644 --- a/winsup/mingw/mingwex/strtold.c +++ b/winsup/mingw/mingwex/strtold.c @@ -255,6 +255,8 @@ expnt: esign = 1; exp = 0; +/* Save position in case we need to fall back. */ +sp = s; ++s; /* check for + or - */ if( *s == '-' ) @@ -265,6 +267,13 @@ if( *s == '-' ) if( *s == '+' ) ++s; +/* Check for valid exponent. */ +if (!(*s >= '0' && *s <= '9')) + { + s = sp; + goto daldone; + } + while( (*s >= '0') && (*s <= '9') ) { /* Stop modifying exp if we are going to overflow anyway, |