In CBPaintText use the text size as returned by LB_GETTEXT. The size
returned by LB_GETTEXTLEN may be too large.
This commit is contained in:
parent
f57112a9f8
commit
93ece68077
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue