From 815a3bd87d61b57d640551386efce9638aa014a0 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 8 May 2026 17:31:02 +0200 Subject: [PATCH] Fix some msg() calls with wrong number of arguments in Windows-only code For some reason neither MSVC nor MinGW complained? cppcheck did (once told that msg is a printf-style function). Change-Id: Ia688ec12e642de699811ced8668b40be9fbb6155 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1672 Message-Id: <20260508153108.13488-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36862.html Signed-off-by: Gert Doering (cherry picked from commit af44c0f8929bc9817a11ac149ae01f3589959325) --- src/openvpnmsica/msiex.c | 2 +- src/tapctl/tap.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openvpnmsica/msiex.c b/src/openvpnmsica/msiex.c index f8bf6aed..4d48f06c 100644 --- a/src/openvpnmsica/msiex.c +++ b/src/openvpnmsica/msiex.c @@ -51,7 +51,7 @@ msi_get_string(_In_ MSIHANDLE hInstall, _In_z_ LPCWSTR szName, _Out_ LPWSTR *psz *pszValue = (LPWSTR)malloc(++dwLength * sizeof(WCHAR)); if (*pszValue == NULL) { - msg(M_FATAL, "%s: malloc(%u) failed", dwLength * sizeof(WCHAR)); + msg(M_FATAL, "%s: malloc(%u) failed", __FUNCTION__, dwLength * sizeof(WCHAR)); return ERROR_OUTOFMEMORY; } diff --git a/src/tapctl/tap.c b/src/tapctl/tap.c index 16e3c0b9..1d94988d 100644 --- a/src/tapctl/tap.c +++ b/src/tapctl/tap.c @@ -487,8 +487,8 @@ get_reg_string(_In_ HKEY hKey, _In_ LPCWSTR szName, _Out_ LPWSTR *pszValue) } default: - msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)", __FUNCTION__, - dwValueType); + msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)", + __FUNCTION__, szName, dwValueType); return ERROR_UNSUPPORTED_TYPE; } }