add posix_close, accepted for inclusion in the next issue of POSIX
[musl] / src / stdio / vfwscanf.c
index 760864f..75f04d7 100644 (file)
@@ -109,6 +109,8 @@ int vfwscanf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap)
 
        for (p=fmt; *p; p++) {
 
+               alloc = 0;
+
                if (iswspace(*p)) {
                        while (iswspace(p[1])) p++;
                        while (iswspace((c=getwc(f)))) pos++;
@@ -141,6 +143,8 @@ int vfwscanf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap)
                }
 
                if (*p=='m') {
+                       wcs = 0;
+                       s = 0;
                        alloc = !!dest;
                        p++;
                } else {