=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: view: Buffer size of GetFileTitleW is in characters, not bytes (coverity).

Alexandre Julliard julliard at winehq.org
Mon Oct 22 13:42:46 CDT 2012


Module: wine
Branch: master
Commit: 0ca586120b7197a784a09836ae450018142320cd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0ca586120b7197a784a09836ae450018142320cd

Author: André Hentschel <nerv at dawncrow.de>
Date:   Mon Oct 22 19:31:36 2012 +0200

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

---

 programs/view/view.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/view/view.c b/programs/view/view.c
index d32a10b..9e60824 100644
--- a/programs/view/view.c
+++ b/programs/view/view.c
@@ -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();
     }




More information about the wine-cvs mailing list