coreboot-kgpe-d16/src/lib/memmove.c
Greg Watson 5c51c3d9d9 tidy
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1409 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-03-13 03:40:29 +00:00

19 lines
309 B
C

#include <string.h>
void *memmove(void *vdest, const void *vsrc, size_t count)
{
const char *src = vsrc;
char *dest = vdest;
if (dest <= src) {
while (count--) {
*dest++ = *src++;
}
} else {
src += count - 1;
dest += count - 1;
while(count--) {
*dest-- = *src--;
}
}
return vdest;
}