From 8b9fbccf2090f121a492a1c83378ab033c6f0ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 31 Jul 2022 00:13:18 +0200 Subject: Use _snwprintf_s instead of swprintf_s for wszf. --- c/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'c') diff --git a/c/common.h b/c/common.h index 7b7e996..8e850ed 100644 --- a/c/common.h +++ b/c/common.h @@ -58,9 +58,9 @@ T* Library::GetProcAddress(const char* const szProc) } template -inline auto wszf(wchar_t (&wsz)[N], const wchar_t* wszFmt, T... xs) +inline int wszf(wchar_t (&wsz)[N], const wchar_t* const wszFmt, T... xs) { - return swprintf_s(wsz, N, wszFmt, xs...); + return _snwprintf_s(wsz, N, _TRUNCATE, wszFmt, xs...); } /* Create and return an object of type C. If construction fails, -- cgit v1.2.3