Commit fe9a0f09 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

Fixed a problem where when deleting an item using index -1 on an empty

listbox we would pass through an illegal negative index and cause problems.
parent 1dc75536
......@@ -1587,7 +1587,7 @@ static LRESULT LISTBOX_RemoveItem( WND *wnd, LB_DESCR *descr, INT index )
LB_ITEMDATA *item;
INT max_items;
if (index == -1) index = descr->nb_items - 1;
if ((index == -1) && (descr->nb_items > 0)) index = descr->nb_items - 1;
else if ((index < 0) || (index >= descr->nb_items)) return LB_ERR;
/* We need to invalidate the original rect instead of the updated one. */
......
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