fix wide scanf's handling of input failure on %c, and simplify %[
[musl] / src / internal / intscan.c
index a00f2cc..d65fc45 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;