LB_GETTEXT: Handle passed NULL buffer.
This commit is contained in:
parent
21777c59c7
commit
4f7dc46ca2
|
@ -636,12 +636,13 @@ static LRESULT LISTBOX_GetText( WND *wnd, LB_DESCR *descr, INT32 index,
|
||||||
if ((index < 0) || (index >= descr->nb_items)) return LB_ERR;
|
if ((index < 0) || (index >= descr->nb_items)) return LB_ERR;
|
||||||
if (HAS_STRINGS(descr))
|
if (HAS_STRINGS(descr))
|
||||||
{
|
{
|
||||||
|
if (!buffer)
|
||||||
|
return strlen(descr->items[index].str);
|
||||||
lstrcpy32A( buffer, descr->items[index].str );
|
lstrcpy32A( buffer, descr->items[index].str );
|
||||||
return strlen(buffer);
|
return strlen(buffer);
|
||||||
}
|
} else {
|
||||||
else
|
if (buffer)
|
||||||
{
|
*((LPDWORD)buffer)=*(LPDWORD)(&descr->items[index].data);
|
||||||
memcpy( buffer, &descr->items[index].data, sizeof(DWORD) );
|
|
||||||
return sizeof(DWORD);
|
return sizeof(DWORD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue