Make sure we don't add the same item twice

Fixes #254
This commit is contained in:
George Oikonomou 2017-12-16 01:15:25 +00:00
parent fe2c960756
commit bcd75789d5

View File

@ -302,7 +302,7 @@ list_insert(list_t list, void *previtem, void *newitem)
if(previtem == NULL) {
list_push(list, newitem);
} else {
list_remove(list, newitem);
((struct list *)newitem)->next = ((struct list *)previtem)->next;
((struct list *)previtem)->next = newitem;
}