bd52d17906
too large to list, but see: http://gcc.gnu.org/gcc-3.4/changes.html http://gcc.gnu.org/gcc-4.0/changes.html http://gcc.gnu.org/gcc-4.1/changes.html for the details.
21 lines
344 B
C
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;
|
|
}
|