aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-05-21 17:11:16 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-05-21 17:11:16 +0200
commit1ede1ed68646d7b95481d1d595aa2c9757326edc (patch)
tree519974beb5988307ef1dbe53ff3a10fb4989928d
parent1c2db8ad6b2629197543547bba4a056e3fb6bfde (diff)
downloadell-1ede1ed68646d7b95481d1d595aa2c9757326edc.tar.gz
ell-1ede1ed68646d7b95481d1d595aa2c9757326edc.tar.xz
ell-1ede1ed68646d7b95481d1d595aa2c9757326edc.zip
Fix crash in print_tree()
-rw-r--r--ell.c3
1 files changed, 2 insertions, 1 deletions
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);