aboutsummaryrefslogtreecommitdiff
path: root/nodelink.c
diff options
context:
space:
mode:
Diffstat (limited to 'nodelink.c')
-rw-r--r--nodelink.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/nodelink.c b/nodelink.c
index b8dbb91..aaf8c18 100644
--- a/nodelink.c
+++ b/nodelink.c
@@ -11,9 +11,15 @@ node* newnode(void) {
return new;
}
+static char* empty(void) {
+ char* out = malloc(sizeof(char));
+ *out = 0;
+ return out;
+}
+
link* newlink(node* to) {
link* new = malloc(sizeof(link));
- new->desc = ""; // preferred to NULL because it can be printed
+ new->desc = empty(); // preferred to NULL because it can be printed
new->to = to;
return new;
}