Simplify logic to use smartlist_add_asprintf()

This commit is contained in:
Nick Mathewson 2020-10-19 11:24:32 -04:00
parent 151d446aa1
commit f7adf3653f

View File

@ -1995,9 +1995,8 @@ dirclient_dump_total_dls(void)
if (options->SafeLogging_ != SAFELOG_SCRUB_NONE &&
purpose_needs_anonymity(i, ROUTER_PURPOSE_GENERAL, NULL))
continue;
char *line = NULL;
tor_asprintf(&line, "%"PRIu64" (%s)", n, dir_conn_purpose_to_string(i));
smartlist_add(lines, line);
smartlist_add_asprintf(lines, "%"PRIu64" (%s)",
n, dir_conn_purpose_to_string(i));
}
if (smartlist_len(lines) > 0) {