notepad: Make sure to use large enough buffer when composing window title (Coverity).

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-03-07 22:04:25 +03:00 committed by Alexandre Julliard
parent 39958094b9
commit ba5e12ae83
1 changed files with 2 additions and 2 deletions

View File

@ -101,9 +101,9 @@ VOID ShowLastError(void)
*/ */
void UpdateWindowCaption(void) void UpdateWindowCaption(void)
{ {
WCHAR szCaption[MAX_STRING_LEN];
WCHAR szNotepad[MAX_STRING_LEN];
static const WCHAR hyphenW[] = { ' ','-',' ',0 }; static const WCHAR hyphenW[] = { ' ','-',' ',0 };
WCHAR szNotepad[64];
WCHAR szCaption[ARRAY_SIZE(Globals.szFileTitle) + ARRAY_SIZE(hyphenW) + ARRAY_SIZE(szNotepad)];
if (Globals.szFileTitle[0] != '\0') if (Globals.szFileTitle[0] != '\0')
lstrcpyW(szCaption, Globals.szFileTitle); lstrcpyW(szCaption, Globals.szFileTitle);