From 1ede1ed68646d7b95481d1d595aa2c9757326edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Sun, 21 May 2017 17:11:16 +0200 Subject: [PATCH] Fix crash in print_tree() --- ell.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ell.c b/ell.c index d73ddc1..9bf1927 100644 --- a/ell.c +++ b/ell.c @@ -416,7 +416,8 @@ print_tree (struct item *tree, int level) { printf ("%*s", level, ""); if (iter->type == ITEM_STRING) { print_string (iter->value); - } else if (iter->head->type == ITEM_STRING + } else if (iter->head + && iter->head->type == ITEM_STRING && !strcmp (iter->head->value, "list")) { printf ("["); print_tree (iter->head->next, level + 1);