mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Use smartlist_asprintf_add() to improve readability.
This commit is contained in:
parent
e42a74e563
commit
86f68ed695
@ -4015,13 +4015,11 @@ control_event_conf_changed(smartlist_t *elements)
|
||||
for (i = 0; i < smartlist_len(elements); i += 2) {
|
||||
char *k = smartlist_get(elements, i);
|
||||
char *v = smartlist_get(elements, i+1);
|
||||
char *tmp;
|
||||
if (v == NULL) {
|
||||
tor_asprintf(&tmp, "650-%s", k);
|
||||
smartlist_asprintf_add(lines, "650-%s", k);
|
||||
} else {
|
||||
tor_asprintf(&tmp, "650-%s=%s", k, v);
|
||||
smartlist_asprintf_add(lines, "650-%s=%s", k, v);
|
||||
}
|
||||
smartlist_add(lines, tmp);
|
||||
}
|
||||
result = smartlist_join_strings(lines, "\r\n", 0, NULL);
|
||||
send_control_event(EVENT_CONF_CHANGED, 0,
|
||||
|
Loading…
Reference in New Issue
Block a user