aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKamran Riaz Khan <krkhan@inspirated.com>2011-08-09 15:18:57 +0500
committerNick Mathewson <nickm@torproject.org>2011-08-10 15:03:24 -0400
commit86f68ed6953620e14c7f9894e01ab2eafea250e7 (patch)
tree13c0acbfb70b22ab87fb2c7022a1ccfa2705652f /src
parente42a74e56351a41c0a68999ed5fce48ab03166d7 (diff)
downloadtor-86f68ed6953620e14c7f9894e01ab2eafea250e7.tar.gz
tor-86f68ed6953620e14c7f9894e01ab2eafea250e7.zip
Use smartlist_asprintf_add() to improve readability.
Diffstat (limited to 'src')
-rw-r--r--src/or/control.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 3943aff96c..706d871d69 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -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,