Parser: Fix fetch_section_first when the section doesn't exist

This commit is contained in:
Martin Duquesnoy 2010-04-17 14:24:08 +02:00
parent 5875af2949
commit 3811d61858
2 changed files with 4 additions and 0 deletions

View File

@ -561,6 +561,7 @@ conf_menu_section(void)
struct conf_sec *menu, **set_menu, **item;
menu = fetch_section_first(NULL, "menu");
set_menu = fetch_section(menu, "set_menu");
CHECK((conf.nmenu = fetch_section_count(set_menu)));

View File

@ -503,6 +503,9 @@ fetch_section_first(struct conf_sec *s, char *name)
if (!strcmp(sec->name, name))
return sec;
if(!sec)
return NULL;
TAILQ_FOREACH(sec, &s->sub, entry)
if (!strcmp(sec->name, name))
return sec;