Commit 0ca58612 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

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

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