From f1fd7c07ea4fecc7a2e4c597c5a47076ccd48547 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 17 Apr 2024 17:22:44 +0200 Subject: [PATCH] fixed linked list linkage problems First of all, is linkage even a word? :D Second thing, I am so fucking stupid... --- src/core/lib/utils/llist.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/lib/utils/llist.c b/src/core/lib/utils/llist.c index a36a3fc..e437eb7 100644 --- a/src/core/lib/utils/llist.c +++ b/src/core/lib/utils/llist.c @@ -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; }