Commit 93ece680 authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

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

returned by LB_GETTEXTLEN may be too large.
parent f57112a9
...@@ -747,7 +747,8 @@ static void CBPaintText( ...@@ -747,7 +747,8 @@ static void CBPaintText(
size = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, id, 0); size = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, id, 0);
if( (pText = HeapAlloc( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR))) ) 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 */ pText[size] = '\0'; /* just in case */
} else return; } else return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment