From a0ff652261af4bebad0419aaf99ccea64c7ccf2e Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Tue, 21 Sep 2021 21:04:13 +0200 Subject: list: tests --- src/list.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/list.c b/src/list.c index 6a0085f..133637b 100644 --- a/src/list.c +++ b/src/list.c @@ -10,12 +10,12 @@ int list_add( list_element_t** _root, void* _data ) { list_element_t** iter = _root; list_element_t* new_element = malloc( sizeof(list_element_t) ); - new_element->data = _data; - new_element->next = NULL; - if( !new_element ) return 1; + new_element->data = _data; + new_element->next = NULL; + while(*iter) iter = & (*iter)->next; -- cgit v1.2.3