From 0b4bd76e6bcb46074719f950f2b8e2cd464d117d Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Wed, 6 Dec 2023 17:16:54 -0500
Subject: old changes I had lying around
Looks like I was trying to implement an splint linter here in order to
disprove null check errors.
This whole thing seems pretty useless except as a C exercise.
Why not just use a Wiki or Knuth's WEB or org-mode or a text file with
indentation?
---
ll.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
(limited to 'll.c')
diff --git a/ll.c b/ll.c
index 910b869..3481b8b 100644
--- a/ll.c
+++ b/ll.c
@@ -1,9 +1,14 @@
#include
+#include
#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;
--
cgit