one more safety check: do not remove element if it's not in any list.

This is the best we can do, but what should be done is to check if
element is really from that list.



SVN revision: 41326
This commit is contained in:
Gustavo Sverzut Barbieri 2009-07-14 14:00:59 +00:00
parent 26a3abe8ef
commit 9af4d08f79
1 changed files with 2 additions and 0 deletions

View File

@ -251,6 +251,8 @@ eina_inlist_remove(Eina_Inlist *list, Eina_Inlist *item)
/* checkme */
EINA_SAFETY_ON_NULL_RETURN_VAL(list, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(item, list);
EINA_SAFETY_ON_TRUE_RETURN_VAL
((item != list) && (item->prev == NULL) && (item->next == NULL), list);
if (item->next)
item->next->prev = item->prev;