I think I found a bug in the function linklist_reverse()
Steps to reproduce:
1 – Build a linked list with whatever object or custom struct you like.
Flags setting don’t matter. For the sake of demonstration let’s say it’s a 7 node linked list.
That’s what I used when I found the bug, but it ought to happen with lists of any length.
2 – Call linklist_reverse() TWICE IN A ROW on the list.
You’ll see that the first time the function will perform as expected.
However, the second time around the linked list will be destroyed.
(i.e. pointer references are lost)
Only one node will still be part of the list.