aboutsummaryrefslogtreecommitdiff
path: root/list.c
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2022-04-09 08:35:46 +0200
committerThomas Schmucker <ts@its1.de>2022-04-09 08:35:46 +0200
commit2863f4f1d2a6a6a8704454824d6c291d2e0d4b5c (patch)
treefea87e427d709790240a42f0091b9df45ab24de7 /list.c
parent011ef70f4c1b6ef8384a3573d93595b42dba4395 (diff)
parent6a06c7048ef256796a1536aa50961896a54c2c7b (diff)
downloaddata-structures-2863f4f1d2a6a6a8704454824d6c291d2e0d4b5c.tar.gz
data-structures-2863f4f1d2a6a6a8704454824d6c291d2e0d4b5c.tar.bz2
data-structures-2863f4f1d2a6a6a8704454824d6c291d2e0d4b5c.zip
Merge branch 'rework-list'
Diffstat (limited to 'list.c')
-rw-r--r--list.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/list.c b/list.c
index 5a6c732..d18dae4 100644
--- a/list.c
+++ b/list.c
@@ -43,11 +43,9 @@ list_insert_next(struct list_item *list, T data)
43{ 43{
44 struct list_item *new_item; 44 struct list_item *new_item;
45 45
46 new_item = malloc(sizeof *new_item); 46 new_item = list_add(list->next, data);
47 if ( new_item ) { 47 if ( new_item ) {
48 new_item->data = data; 48 list->next = new_item;
49 new_item->next = list->next;
50 list->next = new_item;
51 } 49 }
52 else { 50 else {
53 ERROR("out of memory"); 51 ERROR("out of memory");