* libc/stdlib/strtod.c (_strtod_r): Revert change from 2011-05-16.

This commit is contained in:
Corinna Vinschen 2012-12-19 10:16:00 +00:00
parent 17ecab12a8
commit fb2b6cb868
2 changed files with 12 additions and 10 deletions

View File

@ -1,3 +1,7 @@
2012-12-19 Corinna Vinschen <vinschen@redhat.com>
* libc/stdlib/strtod.c (_strtod_r): Revert change from 2011-05-16.
2012-12-18 Jeff Johnston <jjohnstn@redhat.com> 2012-12-18 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/math.h: Remove the log2f macro. * libc/include/math.h: Remove the log2f macro.

View File

@ -309,7 +309,8 @@ _DEFUN (_strtod_r, (ptr, s00, se),
} }
nd0 = nd; nd0 = nd;
if (strncmp (s, _localeconv_r (ptr)->decimal_point, if (strncmp (s, _localeconv_r (ptr)->decimal_point,
strlen (_localeconv_r (ptr)->decimal_point)) == 0) { strlen (_localeconv_r (ptr)->decimal_point)) == 0)
{
decpt = 1; decpt = 1;
c = *(s += strlen (_localeconv_r (ptr)->decimal_point)); c = *(s += strlen (_localeconv_r (ptr)->decimal_point));
if (!nd) { if (!nd) {
@ -327,24 +328,21 @@ _DEFUN (_strtod_r, (ptr, s00, se),
have_dig: have_dig:
nz++; nz++;
if (c -= '0') { if (c -= '0') {
nf += nz;
for(i = 1; i < nz; i++) { for(i = 1; i < nz; i++) {
if (nd <= DBL_DIG + 1) { if (nd++ <= DBL_DIG + 1) {
if (nd + i < 10) if (nd < 10)
y *= 10; y *= 10;
else else
z *= 10; z *= 10;
} }
} }
if (nd <= DBL_DIG + 1) { if (nd++ <= DBL_DIG + 1) {
if (nd + i < 10) if (nd < 10)
y = 10*y + c; y = 10*y + c;
else else
z = 10*z + c; z = 10*z + c;
} }
if (nd <= DBL_DIG + 1) {
nf += nz;
nd += nz;
}
nz = 0; nz = 0;
} }
} }