From: Anders Kjersem andersdev@proton.me
--- dlls/comctl32/listview.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 1a0c919e962..d1d2f0ee263 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -5922,19 +5922,18 @@ static BOOL LISTVIEW_EndEditLabelT(LISTVIEW_INFO *infoPtr, BOOL storeText, BOOL if (storeText) { DWORD len = isW ? GetWindowTextLengthW(infoPtr->hwndEdit) : GetWindowTextLengthA(infoPtr->hwndEdit); + ++len; /* Room for terminator (empty text must notify with "", not NULL) */
- if (len++) - { - if (!(pszText = Alloc(len * (isW ? sizeof(WCHAR) : sizeof(CHAR))))) - return FALSE; + if (!(pszText = Alloc(len * (isW ? sizeof(WCHAR) : sizeof(CHAR))))) + return FALSE;
- if (isW) - GetWindowTextW(infoPtr->hwndEdit, pszText, len); - else - GetWindowTextA(infoPtr->hwndEdit, (CHAR*)pszText, len); - } + if (isW) + GetWindowTextW(infoPtr->hwndEdit, pszText, len); + else + GetWindowTextA(infoPtr->hwndEdit, (CHAR*)pszText, len); }
+ TRACE("(pszText=%s, isW=%d)\n", debugtext_t(pszText, isW), isW);
ZeroMemory(&dispInfo, sizeof(dispInfo));