fix typo in exponent reading code or floats
authorRich Felker <dalias@aerifal.cx>
Wed, 18 Apr 2012 07:53:53 +0000 (03:53 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 18 Apr 2012 07:53:53 +0000 (03:53 -0400)
this was basically harmless, but could have resulted in misreading
inputs with more than a few gigabytes worth of digits..

src/internal/floatscan.c

index da209e278e14e5abe0a39aa5cf59854696207df8..321754314da493b8ea80a411a993fa38e5008b4b 100644 (file)
@@ -44,7 +44,7 @@ static long long scanexp(FILE *f, int pok)
        }
        for (x=0; c-'0'<10U && x<INT_MAX/10; c = shgetc(f))
                x = 10*x + c-'0';
-       for (y=x; c-'0'<10U && x<LLONG_MAX/100; c = shgetc(f))
+       for (y=x; c-'0'<10U && y<LLONG_MAX/100; c = shgetc(f))
                y = 10*y + c-'0';
        for (; c-'0'<10U; c = shgetc(f));
        shunget(f);