diff --git a/src/stdio/vfscanf.c b/src/stdio/vfscanf.c index 9e030fc4..d990db9f 100644 --- a/src/stdio/vfscanf.c +++ b/src/stdio/vfscanf.c @@ -76,6 +76,8 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap) FLOCK(f); + if (!f->rpos && __toread(f)) goto input_fail; + for (p=(const unsigned char *)fmt; *p; p++) { alloc = 0;