kolibrios/contrib/toolchain/gcc/5x/libgcc/memmove.c
Sergey Semyonov (Serge) c7fc8e91d0 libgcc-5.4.0 initial commit
git-svn-id: svn://kolibrios.org@6515 a494cfbc-eb01-0410-851d-a64ba20cac60
2016-09-08 17:51:39 +00:00

21 lines
344 B
C

/* Public domain. */
#include <stddef.h>
void *
memmove (void *dest, const void *src, size_t len)
{
char *d = dest;
const char *s = src;
if (d < s)
while (len--)
*d++ = *s++;
else
{
char *lasts = s + (len-1);
char *lastd = d + (len-1);
while (len--)
*lastd-- = *lasts--;
}
return dest;
}