about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-11-01 18:31:19 +0100
committerMichael Vetter <jubalh@iodoru.org>2019-11-01 18:31:19 +0100
commit8d2b1b05e7f5d1ea5320dded432824e4cf86ebaf (patch)
tree75c83ea79ad465642c29c5626ac094b3dc5cf309 /src
parentbc282ef569ecd068cc8d523601264d9f4beefafe (diff)
downloadprofani-tty-8d2b1b05e7f5d1ea5320dded432824e4cf86ebaf.tar.gz
Initialize ProfBufEntry->id correctly
Diffstat (limited to 'src')
-rw-r--r--src/ui/buffer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ui/buffer.c b/src/ui/buffer.c
index b36f19e7..f24f1d8f 100644
--- a/src/ui/buffer.c
+++ b/src/ui/buffer.c
@@ -91,7 +91,11 @@ buffer_append(ProfBuff buffer, const char show_char, int pad_indent, GDateTime *
     e->from = from ? strdup(from) : NULL;
     e->message = strdup(message);
     e->receipt = receipt;
-    e->id = strdup(id);
+    if (id) {
+        e->id = strdup(id);
+    } else {
+        e->id = NULL;
+    }
 
     if (g_slist_length(buffer->entries) == BUFF_SIZE) {
         _free_entry(buffer->entries->data);