Skip to content

Commit c971eda

Browse files
PaulHigintgauth
andauthored
Address CodeQL issues (#646)
* Address CodeQL issues * Update contrib/win32/win32compat/console.c Co-authored-by: Tess Gauthier <[email protected]> * Update contrib/win32/win32compat/console.c Co-authored-by: Tess Gauthier <[email protected]> Co-authored-by: Tess Gauthier <[email protected]>
1 parent 043a20b commit c971eda

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

contrib/win32/win32compat/console.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,16 +627,14 @@ ConWriteString(char* pszString, int cbString)
627627
if ((needed = MultiByteToWideChar(CP_UTF8, 0, pszString, cbString, NULL, 0)) == 0 ||
628628
(utf16 = malloc(needed * sizeof(wchar_t))) == NULL ||
629629
(cnt = MultiByteToWideChar(CP_UTF8, 0, pszString, cbString, utf16, needed)) == 0) {
630-
const char* pszStringConst = pszString;
631-
Result = (DWORD)printf_s(pszStringConst);
630+
Result = (DWORD)printf_s(pszString); // CodeQL [SM01734] false positive: call is not format string with arguments.
632631
}
633632
else {
634633
if (GetConsoleOutputHandle())
635634
WriteConsoleW(GetConsoleOutputHandle(), utf16, cnt, &Result, 0);
636635
else
637636
{
638-
const wchar_t* utf16Const = utf16;
639-
Result = (DWORD)wprintf_s(utf16Const);
637+
Result = (DWORD)wprintf_s(utf16); // CodeQL [SM01734] false positive: call is not format string with arguments.
640638
}
641639
}
642640

0 commit comments

Comments
 (0)