fix wchar_t array too large

This commit is contained in:
deepzero 2014-01-15 08:49:14 +01:00 committed by cypherpunk
parent 2b40864813
commit 04fc4edbbf
1 changed files with 4 additions and 4 deletions

View File

@ -559,17 +559,17 @@ bool EngineCreatePathForFileW(wchar_t* szFileName)
{
int i,j;
wchar_t szFolderName[2 * MAX_PATH] = {};
wchar_t szCreateFolder[2 * MAX_PATH] = {};
wchar_t szFolderName[MAX_PATH] = {};
wchar_t szCreateFolder[MAX_PATH] = {};
if(engineCreatePathForFiles)
{
i = lstrlenW(szFileName);
while(szFileName[i] != '\\' && i > NULL)
while(szFileName[i] != '\\' && i > 0)
{
i--;
}
if(i != NULL)
if(i != 0)
{
RtlMoveMemory(szFolderName, szFileName, (i * 2) + 2);
if(!CreateDirectoryW(szFolderName, NULL))