Update for recent build tools
[mdsms.git] / memmove.c
diff --git a/memmove.c b/memmove.c
new file mode 100644 (file)
index 0000000..2c0d1d1
--- /dev/null
+++ b/memmove.c
@@ -0,0 +1,22 @@
+#include "config.h"
+#ifndef lint
+static char rcsid[] ATTR_UNUSED = "$Id$";
+#endif
+
+/* This part of code is a public domain */
+
+/* CONFORMING TO SVID 3, BSD 4.3, ISO 9899 */
+
+void *memmove(void *dest, const void *src, size_t n)
+{
+char *cdest,*csrc;
+
+       if (dest==src || !n) return;
+       cdest=dest; csrc=src;
+       if (dest<src) {
+               while (n--) *cdest++=*csrc++;
+       } else {
+               cdest+=n; csrc+=n;
+               while (n--) *--cdest=*--csrc;
+               }
+}