Commit 21777c59 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

CB_GETTEXT: Use lpBuffer instead of lpText for LB_GETTEXT32, handle 0

byte NULL buffer.
parent 9dc32562
......@@ -1001,14 +1001,16 @@ static LRESULT COMBO_GetText( LPHEADCOMBO lphc, UINT32 N, LPSTR lpText)
if( lpBuffer )
{
INT32 n = SendMessage32A( lphc->hWndLBox, LB_GETTEXT32,
(WPARAM32)idx, (LPARAM)lpText );
(WPARAM32)idx, (LPARAM)lpBuffer );
/* truncate if buffer is too short */
if( length >= N )
{
if (N && lpText) {
if( n != LB_ERR ) memcpy( lpText, lpBuffer, (N>n) ? n+1 : N-1 );
lpText[N - 1] = '\0';
}
HeapFree( GetProcessHeap(), 0, lpBuffer );
}
return (LRESULT)n;
......
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