File dialogs now set wopenfilestring to all 0x00's before reusing it.
This commit is contained in:
@@ -172,6 +172,7 @@ file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, WCHAR *title, int save)
|
|||||||
* Set lpstrFile[0] to '\0' so that GetOpenFileName does
|
* Set lpstrFile[0] to '\0' so that GetOpenFileName does
|
||||||
* not use the contents of szFile to initialize itself.
|
* not use the contents of szFile to initialize itself.
|
||||||
*/
|
*/
|
||||||
|
memset(ofn.lpstrFile, 0x00, 512 * sizeof(WCHAR));
|
||||||
memcpy(ofn.lpstrFile, fn, (wcslen(fn) << 1) + 2);
|
memcpy(ofn.lpstrFile, fn, (wcslen(fn) << 1) + 2);
|
||||||
ofn.nMaxFile = sizeof_w(wopenfilestring);
|
ofn.nMaxFile = sizeof_w(wopenfilestring);
|
||||||
ofn.lpstrFilter = f;
|
ofn.lpstrFilter = f;
|
||||||
|
Reference in New Issue
Block a user