From 9b49671d6f4e72d2c68127bf0106dc75e33dd994 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 16 Apr 2021 16:57:39 +0200 Subject: fix: code layout --- list.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/list.c b/list.c index 5c36ea4..6117670 100644 --- a/list.c +++ b/list.c @@ -26,8 +26,8 @@ list_add(struct list_item *next, T data) new_item = malloc(sizeof *new_item); if ( new_item != NULL ) { - new_item->next = next; new_item->data = data; + new_item->next = next; } else { ERROR("out of memory"); @@ -46,7 +46,6 @@ list_insert_next(struct list_item *list, T data) new_item = malloc(sizeof *new_item); if ( new_item != NULL ) { new_item->data = data; - new_item->next = list->next; list->next = new_item; } -- cgit v1.3