crt: Use the right options in the UCRT non-inline _snwprintf
In the inline form of _snwprintf, we set
_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
but in the non-inline version, we just called
vsnwprintf, which doesn't set that option.
Instead call __stdio_common_vswprintf directly, with the right
options.
The previous form stemmed from the original UCRT implementation
in bc6a87488995675ae80c312e3585cb1ace739b43.
Signed-off-by: Martin Storsjö <martin@martin.st>
diff --git a/mingw-w64-crt/stdio/ucrt__snwprintf.c b/mingw-w64-crt/stdio/ucrt__snwprintf.c
index d4d5eff..07cdf18 100644
--- a/mingw-w64-crt/stdio/ucrt__snwprintf.c
+++ b/mingw-w64-crt/stdio/ucrt__snwprintf.c
@@ -30,7 +30,7 @@
va_list ap;
int ret;
va_start(ap, _Format);
- ret = vsnwprintf(_Dest, _Count, _Format, ap);
+ ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Dest, _Count, _Format, NULL, ap);
va_end(ap);
return ret;
}