summaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-06-25 12:05:36 -0400
committerNick Mathewson <nickm@torproject.org>2012-06-25 12:05:36 -0400
commit888d5d08fe4efb52a5923726dcfb75036bf90714 (patch)
tree71cd319e54017d8909e2f9c8201b98b7c4fd7c5f /src/common/util.c
parentaad71eef1b8cf5e6dd74371abc012b342ec3f011 (diff)
parentdcb1d0a67baa35b9645b19f2cf44f8ba3d0b30d1 (diff)
downloadtor-888d5d08fe4efb52a5923726dcfb75036bf90714.tar.gz
tor-888d5d08fe4efb52a5923726dcfb75036bf90714.zip
Merge remote-tracking branch 'public/bug2385'
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index e5b51b9a94..008e26a20c 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -655,6 +655,16 @@ fast_memcmpstart(const void *mem, size_t memlen,
return fast_memcmp(mem, prefix, plen);
}
+/** Given a nul-terminated string s, set every character before the nul
+ * to zero. */
+void
+tor_strclear(char *s)
+{
+ while (*s) {
+ *s++ = '\0';
+ }
+}
+
/** Return a pointer to the first char of s that is not whitespace and
* not a comment, or to the terminating NUL if no such character exists.
*/