[v3] riched20: Properly clear all of a buffer of type WCHAR.

Gerald Pfeifer gerald at pfeifer.com
Tue May 10 09:57:39 CDT 2016


Per Huw's preference this now properly clears this buffer (which 
is of type WCHAR, so MAX_BUF_LEN fell short) using sizeof(...).

Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
---
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index ae9c0a5..6a77d9a 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -3822,7 +3822,7 @@ static void test_EM_SETTEXTEX(void)
   getText.flags = GT_DEFAULT;
   getText.lpDefaultChar = NULL;
   getText.lpUsedDefChar = NULL;
-  memset(buf, 0, MAX_BUF_LEN);
+  memset(buf, 0, sizeof(buf));
   SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buf);
   ok(lstrcmpW(buf, TestItem2) == 0,
       "EM_GETTEXTEX results not what was set by EM_SETTEXTEX\n");
@@ -3837,7 +3837,7 @@ static void test_EM_SETTEXTEX(void)
   getText.flags = GT_USECRLF;   /* <-- asking for CR -> CRLF conversion */
   getText.lpDefaultChar = NULL;
   getText.lpUsedDefChar = NULL;
-  memset(buf, 0, MAX_BUF_LEN);
+  memset(buf, 0, sizeof(buf));
   SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buf);
   ok(lstrcmpW(buf, TestItem1) == 0,
       "EM_GETTEXTEX results not what was set by EM_SETTEXTEX\n");



More information about the wine-patches mailing list