aboutsummaryrefslogtreecommitdiff
path: root/test/StormTest.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2025-06-03 10:29:52 +0200
committerLadislav Zezula <zezula@volny.cz>2025-06-03 10:29:52 +0200
commitd9af7876974f4a98ed0049124c0ee4071916b270 (patch)
tree5f58d6c570f038dff834f1fbafe18e3439e4bfd1 /test/StormTest.cpp
parent630de2ee1925d1d1b9bf1404e189a5a319ee3c1e (diff)
Cosmetics
Diffstat (limited to 'test/StormTest.cpp')
-rwxr-xr-xtest/StormTest.cpp7
1 files changed, 5 insertions, 2 deletions
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)"))