From: Rich Felker Date: Sat, 21 Apr 2012 15:57:39 +0000 (-0400) Subject: fix overread (consuming an extra byte) scanning NAN X-Git-Tag: v0.8.10~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=33e7781b5b71eac594b6fa539f6d75939e9b676d;p=oweals%2Fmusl.git fix overread (consuming an extra byte) scanning NAN bug detected by glib test suite --- 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; }