[PATCH] comctl32: Fixed strncpy (Coverity)
Marcus Meissner
marcus at jet.franken.de
Tue Jun 28 02:15:13 CDT 2011
Hi,
This is a 2 CHAR buffer, and we copy in 1 CHAR and \0. So just do that
via strcpy() and dont confuse the static checker.
CID 1194
Ciao, Marcus
---
dlls/comctl32/tests/treeview.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c
index 324473d..faa9553 100644
--- a/dlls/comctl32/tests/treeview.c
+++ b/dlls/comctl32/tests/treeview.c
@@ -1225,7 +1225,7 @@ static void test_itemedit(void)
r = TreeView_SelectItem(hTree, NULL);
expect(TRUE, r);
/* alter text */
- strncpy(buff, "x", sizeof(buff)/sizeof(CHAR));
+ strcpy(buff, "x");
r = SendMessage(edit, WM_SETTEXT, 0, (LPARAM)buff);
expect(TRUE, r);
r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
--
1.7.3.4
More information about the wine-patches
mailing list