diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-21 15:33:25 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-21 15:33:25 -0400 |
commit | f95e3bf5fc4e2d5fef42b86d81f155c00b1983ac (patch) | |
tree | 75412c13599cfefbd1edb2b38dc3005db8ee7ad0 /src/common/container.c | |
parent | e066966bf48b4f6ca557175cb2ab3e2dffa5b1db (diff) | |
download | tor-f95e3bf5fc4e2d5fef42b86d81f155c00b1983ac.tar.gz tor-f95e3bf5fc4e2d5fef42b86d81f155c00b1983ac.zip |
Simplify include structure of container.[ch]
Diffstat (limited to 'src/common/container.c')
-rw-r--r-- | src/common/container.c | 13 |
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. |