Increased static buffer size and forced initialization (#514)

This is a temporary measure waiting for a more complete refactoring.
This commit is contained in:
Damien GERARD 2015-07-20 11:23:20 +02:00
parent fb452e0c69
commit fe2defb536

View File

@ -162,7 +162,7 @@ int FileDialog::setExtsFilter(const TCHAR *extText, const TCHAR *exts)
return _nbExt;
}
TCHAR * FileDialog::doOpenSingleFileDlg()
TCHAR* FileDialog::doOpenSingleFileDlg()
{
TCHAR dir[MAX_PATH];
::GetCurrentDirectory(MAX_PATH, dir);
@ -212,17 +212,22 @@ stringVector * FileDialog::doOpenMultiFilesDlg()
if (res)
{
TCHAR fn[MAX_PATH];
TCHAR *pFn = _fileName + lstrlen(_fileName) + 1;
TCHAR* pFn = _fileName + lstrlen(_fileName) + 1;
TCHAR fn[MAX_PATH*8];
memset(fn, 0x0, sizeof(fn));
if (!(*pFn))
{
_fileNames.push_back(generic_string(_fileName));
}
else
{
lstrcpy(fn, _fileName);
if (fn[lstrlen(fn)-1] != '\\')
if (fn[lstrlen(fn) - 1] != '\\')
lstrcat(fn, TEXT("\\"));
}
int term = int(lstrlen(fn));
int term = lstrlen(fn);
while (*pFn)
{
@ -234,10 +239,10 @@ stringVector * FileDialog::doOpenMultiFilesDlg()
return &_fileNames;
}
else
return NULL;
return nullptr;
}
TCHAR * FileDialog::doSaveDlg()
{
TCHAR dir[MAX_PATH];