diff options
Diffstat (limited to 'll.c')
-rw-r--r-- | ll.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,9 +1,14 @@ #include <stdlib.h> +#include <assert.h> #include "ll.h" -llnode* appendll(llnode* tail, char* str){ +llnode* appendll(llnode* tail, /*@nottemp@*/char* str){ llnode* new = malloc(sizeof(llnode)); - if (tail != NULL) tail->next = new; + assert(new != NULL); + if (tail != NULL) { + assert(tail->next == NULL); + tail->next = new; + } new->str = str; new->next = NULL; return new; |