ignore remove NULL item from linked list

This commit is contained in:
Matthias Ringwald 2015-05-14 10:17:49 +02:00
parent cbe987fb1e
commit 3e35d521bf

View File

@ -101,6 +101,7 @@ void linked_list_add_tail(linked_list_t * list, linked_item_t *item){ // <-- a
* @note: assumes that data_source_t.next is first element in data_source
*/
int linked_list_remove(linked_list_t * list, linked_item_t *item){ // <-- remove item from list
if (!item) return -1;
linked_item_t *it;
for (it = (linked_item_t *) list; it ; it = it->next){
if (it->next == item){