From c971eda4d6d093ebf712c7e36a4645eae532becd Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Mon, 5 Dec 2022 13:29:32 -0800 Subject: [PATCH] Address CodeQL issues (#646) * Address CodeQL issues * Update contrib/win32/win32compat/console.c Co-authored-by: Tess Gauthier * Update contrib/win32/win32compat/console.c Co-authored-by: Tess Gauthier Co-authored-by: Tess Gauthier --- contrib/win32/win32compat/console.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contrib/win32/win32compat/console.c b/contrib/win32/win32compat/console.c index 396bd7f63..f34a8d19d 100644 --- a/contrib/win32/win32compat/console.c +++ b/contrib/win32/win32compat/console.c @@ -627,16 +627,14 @@ ConWriteString(char* pszString, int cbString) if ((needed = MultiByteToWideChar(CP_UTF8, 0, pszString, cbString, NULL, 0)) == 0 || (utf16 = malloc(needed * sizeof(wchar_t))) == NULL || (cnt = MultiByteToWideChar(CP_UTF8, 0, pszString, cbString, utf16, needed)) == 0) { - const char* pszStringConst = pszString; - Result = (DWORD)printf_s(pszStringConst); + Result = (DWORD)printf_s(pszString); // CodeQL [SM01734] false positive: call is not format string with arguments. } else { if (GetConsoleOutputHandle()) WriteConsoleW(GetConsoleOutputHandle(), utf16, cnt, &Result, 0); else { - const wchar_t* utf16Const = utf16; - Result = (DWORD)wprintf_s(utf16Const); + Result = (DWORD)wprintf_s(utf16); // CodeQL [SM01734] false positive: call is not format string with arguments. } }