mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-03 01:22:31 +00:00
fluid_settings_option_concat: dont count NULL options
should never happen though
This commit is contained in:
parent
4d8954ee30
commit
28edbbfe83
1 changed files with 2 additions and 4 deletions
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue