diff options
author | Ladislav Zezula <zezula@volny.cz> | 2025-06-03 10:29:52 +0200 |
---|---|---|
committer | Ladislav Zezula <zezula@volny.cz> | 2025-06-03 10:29:52 +0200 |
commit | d9af7876974f4a98ed0049124c0ee4071916b270 (patch) | |
tree | 5f58d6c570f038dff834f1fbafe18e3439e4bfd1 /test/StormTest.cpp | |
parent | 630de2ee1925d1d1b9bf1404e189a5a319ee3c1e (diff) |
Cosmetics
Diffstat (limited to 'test/StormTest.cpp')
-rwxr-xr-x | test/StormTest.cpp | 7 |
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)"))
|