Hello Marcus,
On 06/28/2011 09:15 AM, Marcus Meissner wrote:
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);
What about r = SendMessage(edit, WM_SETTEXT, 0, (LPARAM)"x"); No strcpy involved.
expect(TRUE, r); r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
bye michael
On Tue, Jun 28, 2011 at 09:37:39AM +0200, Michael Stefaniuc wrote:
Hello Marcus,
On 06/28/2011 09:15 AM, Marcus Meissner wrote:
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.
...
- strncpy(buff, "x", sizeof(buff)/sizeof(CHAR));
- strcpy(buff, "x");
What is wrong with: buff[0] = 'x'; buff[1] = 0;
David