[PATCH] oleview: fixed size passed to LoadStringW

Marcus Meissner marcus at jet.franken.de
Mon Oct 27 16:12:03 CDT 2008


Hi,

less * through oleview for more bad sizeof()s
found these two, curiously not found by my magic
wrappers.

Ciao, Marcus
---
 programs/oleview/interface.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/programs/oleview/interface.c b/programs/oleview/interface.c
index 9350cea..2459b74 100644
--- a/programs/oleview/interface.c
+++ b/programs/oleview/interface.c
@@ -95,9 +95,9 @@ INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
                 IUnknown_Release(unk);
                 if(hRes == S_OK)
                     LoadString(globals.hMainInst, IDS_FALSE, wszBuf,
-                            sizeof(WCHAR[MAX_LOAD_STRING]));
+                            sizeof(wszBuf)/sizeof(wszBuf[0]));
                 else LoadString(globals.hMainInst, IDS_TRUE, wszBuf,
-                        sizeof(WCHAR[MAX_LOAD_STRING]));
+                        sizeof(wszBuf)/sizeof(wszBuf[0]));
                 hObject = GetDlgItem(hDlgWnd, IDC_ISDIRTY);
                 SetWindowText(hObject, wszBuf);
                 return TRUE;
@@ -106,7 +106,7 @@ INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
                 IPersistStream_GetSizeMax((IPersistStream *)unk, &size);
                 IUnknown_Release(unk);
                 LoadString(globals.hMainInst, IDS_BYTES, wszBuf,
-                        sizeof(WCHAR[MAX_LOAD_STRING]));
+                        sizeof(wszBuf)/sizeof(wszBuf[0]));
                 wsprintfW(wszSize, wszFormat, U(size).LowPart, wszBuf);
                 hObject = GetDlgItem(hDlgWnd, IDC_GETSIZEMAX);
                 SetWindowText(hObject, wszSize);
-- 
1.5.6



More information about the wine-patches mailing list