Fixing segfault in case of empty input
This commit is contained in:
2
xmenu.c
2
xmenu.c
@@ -379,6 +379,8 @@ parsestdin(void)
|
|||||||
char *label, *output;
|
char *label, *output;
|
||||||
unsigned level = 0;
|
unsigned level = 0;
|
||||||
|
|
||||||
|
rootmenu = NULL;
|
||||||
|
|
||||||
while (fgets(buf, BUFSIZ, stdin) != NULL) {
|
while (fgets(buf, BUFSIZ, stdin) != NULL) {
|
||||||
/* get the indentation level */
|
/* get the indentation level */
|
||||||
level = strspn(buf, "\t");
|
level = strspn(buf, "\t");
|
||||||
|
Reference in New Issue
Block a user