aboutsummaryrefslogtreecommitdiff
path: root/src/common/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/container.c')
-rw-r--r--src/common/container.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/container.c b/src/common/container.c
index c30e84ba24..a7810ba90b 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -11,9 +11,7 @@
* a digest-to-void* map.
**/
-#include "common/compat.h"
#include "common/util.h"
-#include "common/torlog.h"
#include "common/container.h"
#include "lib/crypt_ops/crypto_digest.h"
@@ -113,6 +111,17 @@ smartlist_add_all(smartlist_t *s1, const smartlist_t *s2)
s1->num_used = (int) new_size;
}
+/** Append a copy of string to sl */
+void
+smartlist_add_strdup(struct smartlist_t *sl, const char *string)
+{
+ char *copy;
+
+ copy = tor_strdup(string);
+
+ smartlist_add(sl, copy);
+}
+
/** Remove all elements E from sl such that E==element. Preserve
* the order of any elements before E, but elements after E can be
* rearranged.