about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-04-11 23:08:50 -0400
committerRich Felker <dalias@aerifal.cx>2012-04-11 23:08:50 -0400
commit470fecdd3aa90a1787a4f678a8cb76d3641fa9a9 (patch)
treed6ec8923a5c097abe98bc9feeac1c51a28811f20 /src
parent96acdae944f44a4a757cd98de297490fea2dddb5 (diff)
downloadmusl-470fecdd3aa90a1787a4f678a8cb76d3641fa9a9.tar.gz
musl-470fecdd3aa90a1787a4f678a8cb76d3641fa9a9.tar.xz
musl-470fecdd3aa90a1787a4f678a8cb76d3641fa9a9.zip
revert invalid optimization in floatscan
Diffstat (limited to 'src')
-rw-r--r--src/internal/floatscan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c
index a76daa46..28a09c25 100644
--- a/src/internal/floatscan.c
+++ b/src/internal/floatscan.c
@@ -200,7 +200,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
 		/* FIXME: find a way to compute optimal sh */
 		if (rp > 9+9*LD_B1B_DIG) sh = 9;
 		e2 += sh;
-		for (i=0; (k=(a+i & MASK))!=z && i<LD_B1B_DIG+3; i++) {
+		for (k=a; k!=z; k=(k+1 & MASK)) {
 			uint32_t tmp = x[k] & (1<<sh)-1;
 			x[k] = (x[k]>>sh) + carry;
 			carry = (1000000000>>sh) * tmp;
@@ -210,7 +210,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
 				rp -= 9;
 			}
 		}
-		if (carry && k==z) {
+		if (carry) {
 			if ((z+1 & MASK) != a) {
 				x[z] = carry;
 				z = (z+1 & MASK);