ref: 8b178526d17c09010b94b2c6655c0c98648a2f68
dir: /lib/c/src/memmove.c/
/* See LICENSE file for copyright and license details. */
#include <string.h>
#undef memmove
void *
memmove(void *dst, const void *src, size_t n)
{
char *d = dst, *s = (char *) src;
if (d < s) {
while (n-- > 0)
*d++ = *s++;
} else {
s += n-1, d += n-1;
while (n-- > 0)
*d-- = *s--;
}
return dst;
}