about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/stdio/vfscanf.c2
-rw-r--r--src/stdio/vfwscanf.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/stdio/vfscanf.c b/src/stdio/vfscanf.c
index bb928480..68c8e2cf 100644
--- a/src/stdio/vfscanf.c
+++ b/src/stdio/vfscanf.c
@@ -81,6 +81,8 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap)
 
 	for (p=(const unsigned char *)fmt; *p; p++) {
 
+		alloc = 0;
+
 		if (isspace(*p)) {
 			while (isspace(p[1])) p++;
 			shlim(f, 0);
diff --git a/src/stdio/vfwscanf.c b/src/stdio/vfwscanf.c
index 760864ff..44fac78e 100644
--- a/src/stdio/vfwscanf.c
+++ b/src/stdio/vfwscanf.c
@@ -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++;