From 3883338c8121212b3f6f9c020d489d50bbcdd855 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 22 Jun 2018 09:26:19 -0400 Subject: Move smartlist_add_{v,}asprintf into smartlist.[ch] Now that I know that "strings" nests below "container", I know this is safe. --- src/common/util.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'src/common/util.c') diff --git a/src/common/util.c b/src/common/util.c index 597ff2c420..fc996f16c1 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2595,30 +2595,6 @@ expand_filename(const char *filename) #endif /* defined(_WIN32) */ } -/** Append the string produced by tor_asprintf(pattern, ...) - * to sl. */ -void -smartlist_add_asprintf(struct smartlist_t *sl, const char *pattern, ...) -{ - va_list ap; - va_start(ap, pattern); - smartlist_add_vasprintf(sl, pattern, ap); - va_end(ap); -} - -/** va_list-based backend of smartlist_add_asprintf. */ -void -smartlist_add_vasprintf(struct smartlist_t *sl, const char *pattern, - va_list args) -{ - char *str = NULL; - - tor_vasprintf(&str, pattern, args); - tor_assert(str != NULL); - - smartlist_add(sl, str); -} - /** Return a new list containing the filenames in the directory dirname. * Return NULL on error or if dirname is not a directory. */ -- cgit v1.2.3-54-g00ecf