mescc: Tinycc support: memmove.

* mlibc/libc-mes+tcc.c (memmove): Implement.
This commit is contained in:
Jan Nieuwenhuizen 2017-07-30 13:59:06 +02:00
parent af8335dc7a
commit ec3c031b2f

View file

@ -194,8 +194,13 @@ memcpy (void *dest, void const *src, size_t n)
void *
memmove (void *dest, void const *src, size_t n)
{
eputs ("memmove stub\n");
return 0;
if (dest < src)
return memcpy (dest, src, n);
char *p = dest + n;
char const *q = src +n;
while (n--)
*--p = *--q;
return dest;
}
void *