summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-06-18 07:22:36 +0000
committerNick Mathewson <nickm@torproject.org>2006-06-18 07:22:36 +0000
commitaf8096815e126dcab718b2eef6e500ed2aa83912 (patch)
tree1c9f9c8c26f4fc6d47712f702b529ad1ab6f3c73 /src/common/util.h
parent78428dccdbd47af0ca8d39b40c8a3e512d1c1036 (diff)
downloadtor-af8096815e126dcab718b2eef6e500ed2aa83912.tar.gz
tor-af8096815e126dcab718b2eef6e500ed2aa83912.zip
Add a memdup function to util
svn:r6635
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h
index cdcd64f6b4..0518136816 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -67,6 +67,7 @@ void *_tor_malloc_zero(size_t size DMALLOC_PARAMS);
void *_tor_realloc(void *ptr, size_t size DMALLOC_PARAMS);
char *_tor_strdup(const char *s DMALLOC_PARAMS);
char *_tor_strndup(const char *s, size_t n DMALLOC_PARAMS);
+void *_tor_memdup(const void *mem, size_t len DMALLOC_PARAMS);
#ifdef USE_DMALLOC
extern int dmalloc_free(const char *file, const int line, void *pnt,
const int func_id);
@@ -85,6 +86,7 @@ extern int dmalloc_free(const char *file, const int line, void *pnt,
#define tor_realloc(ptr, size) _tor_realloc(ptr, size DMALLOC_ARGS)
#define tor_strdup(s) _tor_strdup(s DMALLOC_ARGS)
#define tor_strndup(s, n) _tor_strndup(s, n DMALLOC_ARGS)
+#define tor_memdup(s, n) _tor_strndup(s, n DMALLOC_ARGS)
/* String manipulation */
#define HEX_CHARACTERS "0123456789ABCDEFabcdef"