Skip to content
Snippets Groups Projects
Commit 93ece680 authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard
Browse files

In CBPaintText use the text size as returned by LB_GETTEXT. The size

returned by LB_GETTEXTLEN may be too large.
parent f57112a9
No related branches found
No related tags found
No related merge requests found
......@@ -747,7 +747,8 @@ static void CBPaintText(
size = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, id, 0);
if( (pText = HeapAlloc( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR))) )
{
SendMessageW(lphc->hWndLBox, LB_GETTEXT, (WPARAM)id, (LPARAM)pText);
/* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */
size=SendMessageW(lphc->hWndLBox, LB_GETTEXT, (WPARAM)id, (LPARAM)pText);
pText[size] = '\0'; /* just in case */
} else return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment