remove LFS64 symbol aliases; replace with dynamic linker remapping
[musl] / src / stdio / vfscanf.c
index 9e030fc..b78a374 100644 (file)
@@ -57,7 +57,7 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap)
 {
        int width;
        int size;
-       int alloc;
+       int alloc = 0;
        int base;
        const unsigned char *p;
        int c, t;
@@ -76,6 +76,9 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap)
 
        FLOCK(f);
 
+       if (!f->rpos) __toread(f);
+       if (!f->rpos) goto input_fail;
+
        for (p=(const unsigned char *)fmt; *p; p++) {
 
                alloc = 0;