[libc] Avoid implicit assumptions about potentially-optimised memcpy()

Do not assume that an architecture-specific optimised memcpy() will
have the same properties as generic_memcpy() in terms of handling
overlapping regions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2016-05-09 16:01:06 +01:00
parent 45cd68c0fb
commit a966570dce

View File

@@ -81,7 +81,7 @@ void * generic_memmove ( void *dest, const void *src, size_t len ) {
uint8_t *dest_bytes = ( dest + len );
if ( dest < src )
return memcpy ( dest, src, len );
return generic_memcpy ( dest, src, len );
while ( len-- )
*(--dest_bytes) = *(--src_bytes);
return dest;