diff --git a/controls/edit.c b/controls/edit.c index 284b18a4f9c..8c63e36b9e9 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -3157,13 +3157,8 @@ static LRESULT EDIT_WM_EraseBkGnd(WND *wnd, EDITSTATE *es, HDC dc) */ static INT EDIT_WM_GetText(WND *wnd, EDITSTATE *es, INT count, LPSTR text) { - INT len = lstrlenA(es->text); - - if (count > len) { - lstrcpyA(text, es->text); - return len; - } else - return -1; + lstrcpynA(text, es->text, count); + return strlen(text); }