aboutsummaryrefslogtreecommitdiff
path: root/dep/StormLib/src/SFileFindFile.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-07-05 14:16:44 +0200
committerShauren <shauren.trinity@gmail.com>2012-07-05 14:16:44 +0200
commit32ba32c4ebe56ba931c8638460c24cd57ae29a75 (patch)
tree2f757648b85ec8989a7dfc573b954b9b4d718650 /dep/StormLib/src/SFileFindFile.cpp
parentc95905ddbb22e2b5b5362b790aa851ef10d4e27e (diff)
parented6f3e2deff55f913f9646db5f540b7704088478 (diff)
Merge branch '4.x' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'dep/StormLib/src/SFileFindFile.cpp')
-rw-r--r--dep/StormLib/src/SFileFindFile.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/dep/StormLib/src/SFileFindFile.cpp b/dep/StormLib/src/SFileFindFile.cpp
index 542637b3668..337be7d2c54 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; // Search mask (variable length)
+ char szSearchMask[1]; // 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,8 +337,6 @@ 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;
}
@@ -378,7 +376,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA
if(nError == ERROR_SUCCESS)
{
memset(hs, 0, sizeof(TMPQSearch));
- hs->szSearchMask = strdup(szMask);
+ strcpy(&hs->szSearchMask[0], szMask);
hs->dwFlagMask = MPQ_FILE_EXISTS;
hs->ha = ha;
@@ -408,7 +406,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA
FreeMPQSearch(hs);
SetLastError(nError);
}
-
+
// Return the result value
return (HANDLE)hs;
}