about summary refs log tree commit diff
path: root/src/internal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-04-22 14:05:12 -0400
committerRich Felker <dalias@aerifal.cx>2012-04-22 14:05:12 -0400
commit02eb568dedadb3d66c2751aba6bea559370ff32c (patch)
tree986ea1d3b991bf4ee8a3c6ad905d16a8db78e178 /src/internal
parent3f4de355ba02b0659ae84b8861f7360658a04b01 (diff)
downloadmusl-02eb568dedadb3d66c2751aba6bea559370ff32c.tar.gz
musl-02eb568dedadb3d66c2751aba6bea559370ff32c.tar.xz
musl-02eb568dedadb3d66c2751aba6bea559370ff32c.zip
remove redundant (unmaintained) check in floatscan
also be extra careful to avoid wrapping the circular buffer early
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/floatscan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c
index aa962f41..f80db383 100644
--- a/src/internal/floatscan.c
+++ b/src/internal/floatscan.c
@@ -89,7 +89,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
 			if (gotrad) break;
 			gotrad = 1;
 			lrp = dc;
-		} else if (k < KMAX-2) {
+		} else if (k < KMAX-3) {
 			dc++;
 			if (c!='0') lnz = dc;
 			if (j) x[k] = x[k]*10 + c-'0';
@@ -101,7 +101,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
 			gotdig=1;
 		} else {
 			dc++;
-			if (c!='0') x[KMAX-3] |= 1;
+			if (c!='0') x[KMAX-4] |= 1;
 		}
 	}
 	if (!gotrad) lrp=dc;
@@ -143,7 +143,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
 	}
 
 	/* Align incomplete final B1B digit */
-	if (k<KMAX && j) {
+	if (j) {
 		for (; j<9; j++) x[k]*=10;
 		k++;
 		j=0;