Commit d7aea962 authored by Ian Pilcher's avatar Ian Pilcher Committed by Alexandre Julliard

Changed FILEDLG95_OnOpen to "double terminate" the returned string if

OFN_ALLOWMULTISELECT is set.
parent 751625e0
......@@ -1493,13 +1493,18 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
}
}
/* Check that size size of the file does not exceed buffer size */
if(strlen(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile)
/* Check that the size of the file does not exceed buffer size.
(Allow for extra \0 if OFN_MULTISELECT is set.) */
if(strlen(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile -
((fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT) ? 1 : 0))
{
LPSTR lpszTemp;
/* fill destination buffer */
strcpy(fodInfos->ofnInfos->lpstrFile, lpstrPathAndFile);
if (fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT)
fodInfos->ofnInfos->lpstrFile[strlen(fodInfos->ofnInfos->lpstrFile)
+ 1] = '\0';
/* set filename offset */
lpszTemp = COMDLG32_PathFindFileNameA(lpstrPathAndFile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment