mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
50 lines
1.9 KiB
Diff
50 lines
1.9 KiB
Diff
diff --git a/dep/StormLib/src/SFileFindFile.cpp b/dep/StormLib/src/SFileFindFile.cpp
|
|
index aa065d2..542637b 100644
|
|
--- a/dep/StormLib/src/SFileFindFile.cpp
|
|
+++ b/dep/StormLib/src/SFileFindFile.cpp
|
|
@@ -31,7 +31,7 @@ struct TMPQSearch
|
|
DWORD dwSearchTableItems; // Number of items in the search table
|
|
DWORD dwNextIndex; // Next file index to be checked
|
|
DWORD dwFlagMask; // For checking flag mask
|
|
- char szSearchMask[1]; // Search mask (variable length)
|
|
+ char * szSearchMask; // Search mask (variable length)
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
@@ -69,7 +69,7 @@ bool CheckWildCard(const char * szString, const char * szWildCard)
|
|
szString++;
|
|
}
|
|
|
|
- // If there is '*', means zero or more chars. We have to
|
|
+ // If there is '*', means zero or more chars. We have to
|
|
// find the sequence after '*'
|
|
if(*szWildCard == '*')
|
|
{
|
|
@@ -337,6 +337,8 @@ static void FreeMPQSearch(TMPQSearch *& hs)
|
|
{
|
|
if(hs->pSearchTable != NULL)
|
|
STORM_FREE(hs->pSearchTable);
|
|
+ if(hs->szSearchMask != NULL)
|
|
+ free(hs->szSearchMask); // allocated with strdup
|
|
STORM_FREE(hs);
|
|
hs = NULL;
|
|
}
|
|
@@ -376,7 +378,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA
|
|
if(nError == ERROR_SUCCESS)
|
|
{
|
|
memset(hs, 0, sizeof(TMPQSearch));
|
|
- strcpy(hs->szSearchMask, szMask);
|
|
+ hs->szSearchMask = strdup(szMask);
|
|
hs->dwFlagMask = MPQ_FILE_EXISTS;
|
|
hs->ha = ha;
|
|
|
|
@@ -406,7 +408,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA
|
|
FreeMPQSearch(hs);
|
|
SetLastError(nError);
|
|
}
|
|
-
|
|
+
|
|
// Return the result value
|
|
return (HANDLE)hs;
|
|
}
|