Fix LinkedList_Remove
The previous version was setting to NULL both tail and head when removing the head or tail item. That was corrupting the list.
This commit is contained in:
parent
7f49c7302d
commit
600047df4f
@ -192,8 +192,11 @@ void LinkedList_Remove(wLinkedList* list, void* value)
|
||||
if (node->next)
|
||||
node->next->prev = node->prev;
|
||||
|
||||
if ((!node->prev) && (!node->next))
|
||||
list->head = list->tail = NULL;
|
||||
if (node == list->head)
|
||||
list->head = node->next;
|
||||
|
||||
if (node == list->tail)
|
||||
list->tail = node->prev;
|
||||
|
||||
free(node);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user