fix endless loop with duplicate sections

fix #191
This commit is contained in:
Sascha Kruse 2014-08-12 20:26:24 +02:00
parent 3e621b994a
commit 716051064a

View File

@ -42,6 +42,12 @@ static int cmdline_find_option(char *key);
section_t *new_section(char *name)
{
for (int i = 0; i < section_count; i++) {
if(!strcmp(name, sections[i].name)) {
die("Dublicate section in dunstrc detected.\n", -1);
}
}
section_count++;
sections = realloc(sections, sizeof(section_t) * section_count);
sections[section_count - 1].name = g_strdup(name);