5c51c3d9d9
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1409 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
19 lines
309 B
C
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;
|
|
}
|