From 28edbbfe838083d0f7530b506deb8b28843f3bee Mon Sep 17 00:00:00 2001 From: derselbst Date: Sat, 3 Nov 2018 14:17:40 +0100 Subject: [PATCH] fluid_settings_option_concat: dont count NULL options should never happen though --- src/utils/fluid_settings.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils/fluid_settings.c b/src/utils/fluid_settings.c index d77d5ed7..02be9a03 100644 --- a/src/utils/fluid_settings.c +++ b/src/utils/fluid_settings.c @@ -1733,7 +1733,6 @@ fluid_settings_option_concat(fluid_settings_t *settings, const char *name, const char *separator) { fluid_setting_node_t *node; - fluid_str_setting_t *setting; fluid_list_t *p, *newlist = NULL; size_t count, len; char *str, *option; @@ -1756,10 +1755,8 @@ fluid_settings_option_concat(fluid_settings_t *settings, const char *name, return (NULL); } - setting = &node->str; - /* Duplicate option list, count options and get total string length */ - for(p = setting->options, count = 0, len = 0; p; p = p->next, count++) + for(p = node->str.options, count = 0, len = 0; p; p = p->next) { option = fluid_list_get(p); @@ -1767,6 +1764,7 @@ fluid_settings_option_concat(fluid_settings_t *settings, const char *name, { newlist = fluid_list_append(newlist, option); len += FLUID_STRLEN(option); + count++; } }