diff --git a/src/extensions-tool/main.c b/src/extensions-tool/main.c index 7cc83de95..e9a457018 100644 --- a/src/extensions-tool/main.c +++ b/src/extensions-tool/main.c @@ -142,9 +142,10 @@ settings_list_remove (GSettings *settings, n_values = g_strv_length (list); new_value = g_new0 (char *, n_values); - for (i = 0, s = (const char **)list; i < n_values; i++, s++) + i = 0; + for (s = (const char **)list; *s != NULL; s++) if (!g_str_equal (*s, value)) - new_value[i] = g_strdup (*s); + new_value[i++] = g_strdup (*s); g_settings_set_strv (settings, key, (const char **)new_value); g_settings_sync ();