Rob Shearman : hhctrl.ocx: Fix the character count passed to GetFullPathNameW in OpenCHM and NavigateToChm .

Alexandre Julliard julliard at winehq.org
Fri Feb 15 05:35:59 CST 2008


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Thu Feb 14 14:38:44 2008 +0000

hhctrl.ocx: Fix the character count passed to GetFullPathNameW in OpenCHM and NavigateToChm.

---

 dlls/hhctrl.ocx/chm.c  |    2 +-
 dlls/hhctrl.ocx/help.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/hhctrl.ocx/chm.c b/dlls/hhctrl.ocx/chm.c
index 2a4bfa8..710013e 100644
--- a/dlls/hhctrl.ocx/chm.c
+++ b/dlls/hhctrl.ocx/chm.c
@@ -342,7 +342,7 @@ CHMInfo *OpenCHM(LPCWSTR szFile)
 
     CHMInfo *ret = heap_alloc_zero(sizeof(CHMInfo));
 
-    res = GetFullPathNameW(szFile, sizeof(file), file, NULL);
+    res = GetFullPathNameW(szFile, sizeof(file)/sizeof(file[0]), file, NULL);
     ret->szFile = strdupW(file);
 
     hres = CoCreateInstance(&CLSID_ITStorage, NULL, CLSCTX_INPROC_SERVER,
diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c
index c49d3cf..3f6a080 100644
--- a/dlls/hhctrl.ocx/help.c
+++ b/dlls/hhctrl.ocx/help.c
@@ -115,7 +115,7 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
     if (!info->web_browser)
         return FALSE;
 
-    if(!GetFullPathNameW(file, sizeof(full_path), full_path, NULL)) {
+    if(!GetFullPathNameW(file, sizeof(full_path)/sizeof(full_path[0]), full_path, NULL)) {
         WARN("GetFullPathName failed: %u\n", GetLastError());
         return FALSE;
     }




More information about the wine-cvs mailing list