diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2012-12-19 10:16:00 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2012-12-19 10:16:00 +0000 |
commit | fb2b6cb86890a59fcfc7085a0b966f30563990af (patch) | |
tree | 77142615ac2c8cf0a41bcbf942022f86bbd9814a /newlib/libc/stdlib/strtod.c | |
parent | 17ecab12a81003db4362156044a75df35defa227 (diff) | |
download | cygnal-fb2b6cb86890a59fcfc7085a0b966f30563990af.tar.gz cygnal-fb2b6cb86890a59fcfc7085a0b966f30563990af.tar.bz2 cygnal-fb2b6cb86890a59fcfc7085a0b966f30563990af.zip |
* libc/stdlib/strtod.c (_strtod_r): Revert change from 2011-05-16.
Diffstat (limited to 'newlib/libc/stdlib/strtod.c')
-rw-r--r-- | newlib/libc/stdlib/strtod.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c index 7e73b12ac..fe6aac206 100644 --- a/newlib/libc/stdlib/strtod.c +++ b/newlib/libc/stdlib/strtod.c @@ -309,7 +309,8 @@ _DEFUN (_strtod_r, (ptr, s00, se), } nd0 = nd; if (strncmp (s, _localeconv_r (ptr)->decimal_point, - strlen (_localeconv_r (ptr)->decimal_point)) == 0) { + strlen (_localeconv_r (ptr)->decimal_point)) == 0) + { decpt = 1; c = *(s += strlen (_localeconv_r (ptr)->decimal_point)); if (!nd) { @@ -327,28 +328,25 @@ _DEFUN (_strtod_r, (ptr, s00, se), have_dig: nz++; if (c -= '0') { + nf += nz; for(i = 1; i < nz; i++) { - if (nd <= DBL_DIG + 1) { - if (nd + i < 10) + if (nd++ <= DBL_DIG + 1) { + if (nd < 10) y *= 10; else z *= 10; } } - if (nd <= DBL_DIG + 1) { - if (nd + i < 10) + if (nd++ <= DBL_DIG + 1) { + if (nd < 10) y = 10*y + c; else z = 10*z + c; } - if (nd <= DBL_DIG + 1) { - nf += nz; - nd += nz; - } nz = 0; + } } } - } dig_done: e = 0; if (c == 'e' || c == 'E') { |