fluid_settings_option_concat: dont count NULL options

should never happen though
This commit is contained in:
derselbst 2018-11-03 14:17:40 +01:00
parent 4d8954ee30
commit 28edbbfe83

View file

@ -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++;
}
}