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:
parent
586df77ff4
commit
f1fd7c07ea
@ -39,11 +39,15 @@ void why2_list_push(why2_list_t *list, void *value, unsigned long size)
|
|||||||
buffer = new_node;
|
buffer = new_node;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
why2_node_t *buffer_2 = buffer;
|
||||||
|
|
||||||
while (buffer -> next != NULL) buffer = buffer -> next; //GET TO THE END OF LIST
|
while (buffer -> next != NULL) buffer = buffer -> next; //GET TO THE END OF LIST
|
||||||
|
|
||||||
buffer -> next = new_node; //LINK
|
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;
|
list -> head = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user