fix failure of int parser to unget an initial mismatching character
authorRich Felker <dalias@aerifal.cx>
Wed, 18 Apr 2012 01:17:19 +0000 (21:17 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 18 Apr 2012 01:17:19 +0000 (21:17 -0400)
src/internal/intscan.c

index a00f2ccc2206de3acfd2641c1f33b65f015c6580..d65fc45c3c5359a7ffc88066b13cfeaf805a02fb 100644 (file)
@@ -54,6 +54,7 @@ unsigned long long __intscan(FILE *f, unsigned base, int pok, unsigned long long
        } else {
                if (base == 0) base = 10;
                if (val[c] >= base) {
+                       shunget(f);
                        shlim(f, 0);
                        errno = EINVAL;
                        return 0;