]> wimlib.net Git - wimlib/blobdiff - src/win32_common.c
win32_common: fix windows_msg() with long messages
[wimlib] / src / win32_common.c
index d3007916c89ef53c6f98b718f85af18b30a8850f..47f2df307375b5591a770e97b42ff41774f2160b 100644 (file)
@@ -220,7 +220,7 @@ win32_get_drive_path(const wchar_t *file_path, wchar_t drive_path[7])
        return 0;
 }
 
-/* Try to attach an instance of the Windows Overlay File System Filter Driver to
+/* Try to attach an instance of the Windows Overlay Filesystem filter driver to
  * the specified drive (such as C:)  */
 bool
 win32_try_to_attach_wof(const wchar_t *drive)
@@ -274,9 +274,12 @@ windows_msg(u32 code, const wchar_t *format, va_list va,
        size_t buflen = ARRAY_LEN(_buf);
        size_t ret;
        size_t n;
+       va_list va2;
 
 retry:
-       n = vsnwprintf(buf, buflen, format, va);
+       va_copy(va2, va);
+       n = vsnwprintf(buf, buflen, format, va2);
+       va_end(va2);
 
        if (n >= buflen)
                goto realloc;