[BROWSEUI] Follow up of #1121
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Thu, 13 Dec 2018 11:40:05 +0000 (20:40 +0900)
committerKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Thu, 13 Dec 2018 11:40:05 +0000 (20:40 +0900)
CORE-15434

dll/win32/shell32/dialogs/dialogs.cpp

index f2fce61..5903fe4 100644 (file)
@@ -578,7 +578,7 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
 
                     if (wcschr(psz, L'%') != NULL)
                     {
-                        cchExpand = ExpandEnvironmentStringsW(psz, NULL, 0) + 1;
+                        cchExpand = ExpandEnvironmentStringsW(psz, NULL, 0);
                         pszExpanded = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, cchExpand * sizeof(WCHAR));
                         if (!pszExpanded)
                         {