view: Buffer size of GetFileTitleW is in characters, not bytes (coverity).

This commit is contained in:
André Hentschel 2012-10-22 19:31:36 +02:00 committed by Alexandre Julliard
parent 9d6c003cd7
commit 0ca586120b
1 changed files with 2 additions and 2 deletions

View File

@ -260,7 +260,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM
if (FileOpen(hwnd, filename, sizeof(filename)/sizeof(WCHAR)))
{
szFileTitle[0] = 0;
GetFileTitleW(filename, szFileTitle, sizeof(szFileTitle));
GetFileTitleW(filename, szFileTitle, sizeof(szFileTitle)/sizeof(WCHAR));
DoOpenFile(filename);
UpdateWindowCaption();
}
@ -387,7 +387,7 @@ static void HandleCommandLine(LPWSTR cmdline)
cmdline[lstrlenW(cmdline) - 1] = 0;
}
szFileTitle[0] = 0;
GetFileTitleW(cmdline, szFileTitle, sizeof(szFileTitle));
GetFileTitleW(cmdline, szFileTitle, sizeof(szFileTitle)/sizeof(WCHAR));
DoOpenFile(cmdline);
UpdateWindowCaption();
}