From fe4ae456f8c6b6a3775bebfac2f88033891f10d0 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 18 Dec 2021 17:49:14 +0100 Subject: [PATCH] File dialogs now set wopenfilestring to all 0x00's before reusing it. --- src/win/win_dialog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/win/win_dialog.c b/src/win/win_dialog.c index 6f37f46b0..c7d07955d 100644 --- a/src/win/win_dialog.c +++ b/src/win/win_dialog.c @@ -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 * not use the contents of szFile to initialize itself. */ + memset(ofn.lpstrFile, 0x00, 512 * sizeof(WCHAR)); memcpy(ofn.lpstrFile, fn, (wcslen(fn) << 1) + 2); ofn.nMaxFile = sizeof_w(wopenfilestring); ofn.lpstrFilter = f;