From 93ece68077f7dc82b838409494e18830fc033275 Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Tue, 15 Jan 2002 20:27:12 +0000 Subject: [PATCH] In CBPaintText use the text size as returned by LB_GETTEXT. The size returned by LB_GETTEXTLEN may be too large. --- controls/combo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controls/combo.c b/controls/combo.c index 21183ac9588..f09969a27ec 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -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; }