summaryrefslogtreecommitdiff
path: root/src/ll.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ll.c')
-rw-r--r--src/ll.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ll.c b/src/ll.c
index 4e018f2..1fa8773 100644
--- a/src/ll.c
+++ b/src/ll.c
@@ -4,6 +4,7 @@
4#include <stddef.h> 4#include <stddef.h>
5#include <stdlib.h> 5#include <stdlib.h>
6#include <errno.h> 6#include <errno.h>
7#include <error.h>
7 8
8typedef struct dll { 9typedef struct dll {
9 void *data; 10 void *data;
@@ -118,7 +119,8 @@ int dlinkedlist_xxxend(dlinkedlist * const ll, void *data, dll_freecb fcb, char
118 break; 119 break;
119 120
120 default: 121 default:
121 abort(); 122 XALLOC_EXIT("<dlinkedlist_xxxend> got an invalid op token when it shouldn't be possible to recieve one");
123 // Technically not an alloc, but also there's no reason I can't reuse a perfectly good macro
122 } 124 }
123 125
124 ll->size++; 126 ll->size++;
@@ -172,7 +174,7 @@ int dlinkedlist_insert(dlinkedlist * const ll, void *data, dll_freecb fcb, int i
172 dllnode *new = dllnode_init(data, fcb); 174 dllnode *new = dllnode_init(data, fcb);
173 dllnode *current = dlinkedlist_getnode(ll, index); 175 dllnode *current = dlinkedlist_getnode(ll, index);
174 if(!current) 176 if(!current)
175 abort(); 177 XALLOC_EXIT("<dlinkedlist_insert> somehow managed to pull a null node from dlinkedlist_getnode(... , ... , ... , %d)", , (index));
176 178
177 current->prev->next = new; 179 current->prev->next = new;
178 new->prev = current->prev; 180 new->prev = current->prev;