Fix crash in print_tree()

This commit is contained in:
Přemysl Eric Janouch 2017-05-21 17:11:16 +02:00
parent 1c2db8ad6b
commit 1ede1ed686
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 2 additions and 1 deletions

3
ell.c
View File

@ -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);