Fixing segfault in case of empty input

This commit is contained in:
phillbush 2020-05-29 23:55:37 -03:00
parent a5ddd2cd22
commit ddb15acfde

View File

@ -379,6 +379,8 @@ parsestdin(void)
char *label, *output;
unsigned level = 0;
rootmenu = NULL;
while (fgets(buf, BUFSIZ, stdin) != NULL) {
/* get the indentation level */
level = strspn(buf, "\t");