[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:
parent
45cd68c0fb
commit
a966570dce
|
@ -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;
|
||||
|
|
Reference in New Issue