mirror of
https://github.com/profanity-im/profanity.git
synced 2024-06-30 21:55:24 +00:00
Remove string allocation for conflists
This commit is contained in:
parent
d24a0508f4
commit
44862fe842
|
@ -64,7 +64,7 @@ conf_string_list_add(GKeyFile *keyfile, const char *const group, const char *con
|
||||||
GList *curr = glist;
|
GList *curr = glist;
|
||||||
i = 0;
|
i = 0;
|
||||||
while (curr) {
|
while (curr) {
|
||||||
new_list[i++] = strdup(curr->data);
|
new_list[i++] = curr->data;
|
||||||
curr = g_list_next(curr);
|
curr = g_list_next(curr);
|
||||||
}
|
}
|
||||||
new_list[i] = NULL;
|
new_list[i] = NULL;
|
||||||
|
@ -73,7 +73,7 @@ conf_string_list_add(GKeyFile *keyfile, const char *const group, const char *con
|
||||||
// list not found
|
// list not found
|
||||||
} else {
|
} else {
|
||||||
const gchar* new_list[2];
|
const gchar* new_list[2];
|
||||||
new_list[0] = strdup(item);
|
new_list[0] = item;
|
||||||
new_list[1] = NULL;
|
new_list[1] = NULL;
|
||||||
g_key_file_set_string_list(keyfile, group, key, new_list, 1);
|
g_key_file_set_string_list(keyfile, group, key, new_list, 1);
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ conf_string_list_remove(GKeyFile *keyfile, const char *const group, const char *
|
||||||
GList *curr = glist;
|
GList *curr = glist;
|
||||||
i = 0;
|
i = 0;
|
||||||
while (curr) {
|
while (curr) {
|
||||||
new_list[i++] = strdup(curr->data);
|
new_list[i++] = curr->data;
|
||||||
curr = g_list_next(curr);
|
curr = g_list_next(curr);
|
||||||
}
|
}
|
||||||
new_list[i] = NULL;
|
new_list[i] = NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user