fixed linked list linkage problems

First of all, is linkage even a word? :D Second thing, I am so fucking stupid...
This commit is contained in:
Václav Šmejkal 2024-04-17 17:22:44 +02:00
parent 586df77ff4
commit f1fd7c07ea
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -39,11 +39,15 @@ void why2_list_push(why2_list_t *list, void *value, unsigned long size)
buffer = new_node;
} else
{
why2_node_t *buffer_2 = buffer;
while (buffer -> next != NULL) buffer = buffer -> next; //GET TO THE END OF LIST
buffer -> next = new_node; //LINK
buffer = buffer_2; //GO BACK TO THE START OF THE LLIST
}
//APPEND THE new_node TO THE END OF list
list -> head = buffer;
}