aboutsummaryrefslogtreecommitdiff
path: root/ll.c
diff options
context:
space:
mode:
Diffstat (limited to 'll.c')
-rw-r--r--ll.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ll.c b/ll.c
index 910b869..3481b8b 100644
--- a/ll.c
+++ b/ll.c
@@ -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;