Don't copy lpstrFileTitle if given NULL pointer for this.
Delphi 2.0 passes NULL for lpstrFileTitle to GetOpen/SaveFileName.
This commit is contained in:
parent
5eaf775dae
commit
e16512ba82
|
@ -1167,7 +1167,9 @@ static BOOL Commdlg_GetFileNameA( BOOL16 (CALLBACK *dofunction)(SEGPTR x),
|
|||
|
||||
if (ofn16->lpstrFileTitle)
|
||||
{
|
||||
strcpy(ofn->lpstrFileTitle,PTR_SEG_TO_LIN(ofn16->lpstrFileTitle));
|
||||
if (ofn->lpstrFileTitle)
|
||||
strcpy(ofn->lpstrFileTitle,
|
||||
PTR_SEG_TO_LIN(ofn16->lpstrFileTitle));
|
||||
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrFileTitle));
|
||||
}
|
||||
SEGPTR_FREE(ofn16);
|
||||
|
@ -1270,8 +1272,10 @@ static BOOL Commdlg_GetFileNameW( BOOL16 (CALLBACK *dofunction)(SEGPTR x),
|
|||
}
|
||||
|
||||
if (ofn16->lpstrFileTitle) {
|
||||
lstrcpyAtoW(ofn->lpstrFileTitle,PTR_SEG_TO_LIN(ofn16->lpstrFileTitle));
|
||||
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrFileTitle));
|
||||
if (ofn->lpstrFileTitle)
|
||||
lstrcpyAtoW(ofn->lpstrFileTitle,
|
||||
PTR_SEG_TO_LIN(ofn16->lpstrFileTitle));
|
||||
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrFileTitle));
|
||||
}
|
||||
SEGPTR_FREE(ofn16);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue