From dc03eb8aa52a9c3aacf2abc2efe1b07e50b37f62 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Tue, 15 Sep 2009 17:00:08 +0200 Subject: [PATCH] Conf: Fix segfault when there is no value in layout system option. --- src/config.c | 3 ++- src/confparse/util.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index 44dd927..672e44b 100644 --- a/src/config.c +++ b/src/config.c @@ -276,7 +276,8 @@ conf_layout_section(char *src) conf.colors.layout_fg = get_opt(src, "#ffffff", "fg").str; conf.colors.layout_bg = getcolor((get_opt(src, "#000000", "bg").str)); - if(strcmp(get_opt(src, "menu", "system").str, "menu") == 0) + + if((tmp = get_opt(src, "menu", "system").str) && !strcmp(tmp, "menu")) conf.layout_system = True; conf.nlayout = get_size_sec(src, "layout"); diff --git a/src/confparse/util.c b/src/confparse/util.c index 9c19f2a..4156fc5 100644 --- a/src/confparse/util.c +++ b/src/confparse/util.c @@ -48,7 +48,6 @@ erase_delim_content(char *buf) str[j] = ' '; } - return str; }