use restrict everywhere it's required by c99 and/or posix 2008
[musl] / src / stdio / vfscanf.c
index 73294cd..54d0849 100644 (file)
@@ -71,7 +71,7 @@ static int readwc(int c, wchar_t **wcs, mbstate_t *st)
        return 0;
 }
 
-int vfscanf(FILE *f, const char *fmt, va_list ap)
+int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap)
 {
        int width;
        int size;
@@ -103,6 +103,7 @@ int vfscanf(FILE *f, const char *fmt, va_list ap)
                }
                if (*p != '%' || p[1] == '%') {
                        p += *p=='%';
+                       shlim(f, 0);
                        c = shgetc(f);
                        if (c!=*p) {
                                shunget(f);
@@ -291,7 +292,7 @@ int vfscanf(FILE *f, const char *fmt, va_list ap)
                case 'e': case 'E':
                case 'f': case 'F':
                case 'g': case 'G':
-                       y = __floatscan(f, -1, size, 0);
+                       y = __floatscan(f, size, 0);
                        if (!shcnt(f)) goto match_fail;
                        if (dest) switch (size) {
                        case SIZE_def: