diff options
| author | Thomas Schmucker <ts@its1.de> | 2022-04-09 08:35:46 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2022-04-09 08:35:46 +0200 |
| commit | 2863f4f1d2a6a6a8704454824d6c291d2e0d4b5c (patch) | |
| tree | fea87e427d709790240a42f0091b9df45ab24de7 | |
| parent | 011ef70f4c1b6ef8384a3573d93595b42dba4395 (diff) | |
| parent | 6a06c7048ef256796a1536aa50961896a54c2c7b (diff) | |
| download | data-structures-2863f4f1d2a6a6a8704454824d6c291d2e0d4b5c.tar.gz data-structures-2863f4f1d2a6a6a8704454824d6c291d2e0d4b5c.tar.bz2 data-structures-2863f4f1d2a6a6a8704454824d6c291d2e0d4b5c.zip | |
Merge branch 'rework-list'
| -rw-r--r-- | list.c | 6 |
1 files changed, 2 insertions, 4 deletions
| @@ -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"); |
