about summary refs log tree commit diff
path: root/src/internal/floatscan.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-04-21 11:57:39 -0400
committerRich Felker <dalias@aerifal.cx>2012-04-21 11:57:39 -0400
commit33e7781b5b71eac594b6fa539f6d75939e9b676d (patch)
treee01dd301660760c6a25a4d784d143464927312db /src/internal/floatscan.c
parentc61312596608bf819b693c04a395f1b4e3e0acf0 (diff)
downloadmusl-33e7781b5b71eac594b6fa539f6d75939e9b676d.tar.gz
musl-33e7781b5b71eac594b6fa539f6d75939e9b676d.tar.xz
musl-33e7781b5b71eac594b6fa539f6d75939e9b676d.zip
fix overread (consuming an extra byte) scanning NAN
bug detected by glib test suite
Diffstat (limited to 'src/internal/floatscan.c')
-rw-r--r--src/internal/floatscan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c
index 7381e9a4..b260381e 100644
--- a/src/internal/floatscan.c
+++ b/src/internal/floatscan.c
@@ -436,7 +436,7 @@ long double __floatscan(FILE *f, int prec, int pok)
 		return sign * INFINITY;
 	}
 	if (!i) for (i=0; i<3 && (c|32)=="nan"[i]; i++)
-		if (i<3) c = shgetc(f);
+		if (i<2) c = shgetc(f);
 	if (i==3) {
 		return NAN;
 	}