[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Simplify logic to use smartlist_add_asprintf()
commit f7adf3653ff313d45d70bed7c0fdcdd0d64f29ab
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Mon Oct 19 11:24:32 2020 -0400
Simplify logic to use smartlist_add_asprintf()
---
src/feature/dirclient/dirclient.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c
index c83c93f56d..b41ae107b3 100644
--- a/src/feature/dirclient/dirclient.c
+++ b/src/feature/dirclient/dirclient.c
@@ -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) {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits