summaryrefslogtreecommitdiffstats
path: root/lib/strutils.c
diff options
context:
space:
mode:
authorDaniel Trebbien2013-01-31 00:49:08 +0100
committerDaniel Trebbien2013-01-31 00:53:00 +0100
commit02887b73ebdbf3a222b87d8f09c65b58b7b9a696 (patch)
treee5a8295d2cfdefa08d479b74645a15fb2ec8c0cb /lib/strutils.c
parenttextual: improve an error message and a help text (diff)
downloadkernel-qcow2-util-linux-02887b73ebdbf3a222b87d8f09c65b58b7b9a696.tar.gz
kernel-qcow2-util-linux-02887b73ebdbf3a222b87d8f09c65b58b7b9a696.tar.xz
kernel-qcow2-util-linux-02887b73ebdbf3a222b87d8f09c65b58b7b9a696.zip
Implement mempcpy() in terms of memcpy() if mempcpy() is unavailable
Diffstat (limited to 'lib/strutils.c')
-rw-r--r--lib/strutils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/strutils.c b/lib/strutils.c
index 5dda13805..2337b07b9 100644
--- a/lib/strutils.c
+++ b/lib/strutils.c
@@ -132,6 +132,13 @@ err:
return -1;
}
+#ifndef HAVE_MEMPCPY
+void *mempcpy(void *restrict dest, const void *restrict src, size_t n)
+{
+ return ((char *)memcpy(dest, src, n)) + n;
+}
+#endif
+
#ifndef HAVE_STRNLEN
size_t strnlen(const char *s, size_t maxlen)
{