aboutsummaryrefslogtreecommitdiff
path: root/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'list.c')
-rw-r--r--list.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/list.c b/list.c
index fb21779..da0c702 100644
--- a/list.c
+++ b/list.c
@@ -33,17 +33,16 @@ list_add(struct list_item *next, T data)
33} 33}
34 34
35void 35void
36list_insert_next(struct list_item *node, T data) 36list_insert_next(struct list_item *list, T data)
37{ 37{
38 struct list_item *new_item; 38 struct list_item *new_item;
39 39
40 // TODO: Debuggen und nochmal richtig drüber nachdenken!
41 new_item = malloc(sizeof *new_item); 40 new_item = malloc(sizeof *new_item);
42 if ( new_item != NULL ) { 41 if ( new_item != NULL ) {
43 new_item->next = node->next;
44 new_item->data = data; 42 new_item->data = data;
45 43
46 node->next = new_item; 44 new_item->next = list->next;
45 list->next = new_item;
47 } 46 }
48 else 47 else
49 ERROR("out of memory"); 48 ERROR("out of memory");
@@ -76,7 +75,6 @@ list_delete(struct list_item *list, T data)
76void 75void
77list_delete_next(struct list_item *list) 76list_delete_next(struct list_item *list)
78{ 77{
79 // TODO: Debuggen und nochmal richtig drüber nachdenken!
80 if ( list->next != NULL ) { 78 if ( list->next != NULL ) {
81 struct list_item *temp = list->next; 79 struct list_item *temp = list->next;
82 80