From 47e919424da36ab1cf92c6829bca69d7811d4b14 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 28 Feb 2010 21:46:50 -0500 Subject: Tweak users of snprintf to use asprintf where appropriate --- src/or/control.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/or/control.c') diff --git a/src/or/control.c b/src/or/control.c index 5101fdef42..4fc9b7f345 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1883,18 +1883,18 @@ static char * list_getinfo_options(void) { int i; - char buf[300]; + char *buf=NULL; smartlist_t *lines = smartlist_create(); char *ans; for (i = 0; getinfo_items[i].varname; ++i) { if (!getinfo_items[i].desc) continue; - tor_snprintf(buf, sizeof(buf), "%s%s -- %s\n", + tor_asprintf(&buf, "%s%s -- %s\n", getinfo_items[i].varname, getinfo_items[i].is_prefix ? "*" : "", getinfo_items[i].desc); - smartlist_add(lines, tor_strdup(buf)); + smartlist_add(lines, buf); } smartlist_sort_strings(lines); -- cgit v1.2.3-54-g00ecf