From d9af7876974f4a98ed0049124c0ee4071916b270 Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Tue, 3 Jun 2025 10:29:52 +0200 Subject: Cosmetics --- test/StormTest.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/StormTest.cpp') diff --git a/test/StormTest.cpp b/test/StormTest.cpp index dba91f3..c5b5121 100755 --- a/test/StormTest.cpp +++ b/test/StormTest.cpp @@ -1436,9 +1436,12 @@ static DWORD LoadMpqFile(TLogHelper & Logger, HANDLE hMpq, LPCSTR szFileName, LC DWORD dwBytesRead; DWORD dwCrc32 = 0; DWORD dwErrCode = ERROR_SUCCESS; + TCHAR szSafeName[1024]; - // Do nothing if the file name is invalid - Logger.PrintProgress("Loading file %s ...", GetShortPlainName(szFileName)); + // Print the file name to the console. + // Prevent bad UTF-8 sequences to go through + SMemUTF8ToFileName(szSafeName, _countof(szSafeName), szFileName, NULL, 0, NULL); + Logger.PrintProgress(_T("Loading file %s ..."), GetShortPlainName(szSafeName)); #if defined(_MSC_VER) && defined(_DEBUG) //if(!_stricmp(szFileName, "(signature)")) -- cgit v1.2.3