summaryrefslogtreecommitdiff
path: root/libbb/xfuncs_printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/xfuncs_printf.c')
-rw-r--r--libbb/xfuncs_printf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c
index e4ac6a0..7348890 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -112,6 +112,11 @@ char* FAST_FUNC xstrndup(const char *s, int n)
return memcpy(t, s, n);
}
+void* FAST_FUNC xmemdup(const void *s, int n)
+{
+ return memcpy(xmalloc(n), s, n);
+}
+
// Die if we can't open a file and return a FILE* to it.
// Notice we haven't got xfread(), This is for use with fscanf() and friends.
FILE* FAST_FUNC xfopen(const char *path, const char *mode)