Fix a couple possible buffer overruns.

This commit is contained in:
Unknown W. Brackets committed 2015-01-18 13:16:34 -08:00
1 parent 45ec0c8a14
commit 964a50ca05
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -64,8 +64,8 @@ namespace W32Util
ofn.hwndOwner = _hParent;
ofn.Flags = OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_HIDEREADONLY;
if (_strFileName.size () != 0)
wcscpy(ofn.lpstrFile, ConvertUTF8ToWString(_strFileName).c_str());
if (!_strFileName.empty())
wcsncpy(ofn.lpstrFile, ConvertUTF8ToWString(_strFileName).c_str(), MAX_PATH);
if (((_bLoad) ? GetOpenFileName(&ofn) : GetSaveFileName (&ofn)))
{