mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibC: Support backwards copy in memmove().
This commit is contained in:
@@ -141,8 +141,12 @@ void* memmove(void* dest, const void* src, size_t n)
|
||||
{
|
||||
if (dest < src)
|
||||
return memcpy(dest, src, n);
|
||||
// FIXME: Implement backwards copy.
|
||||
assert(false);
|
||||
|
||||
byte *pd = (byte*)dest;
|
||||
const byte *ps = (const byte*)src;
|
||||
for (pd += n, ps += n; n--;)
|
||||
*--pd = *--ps;
|
||||
return dest;
|
||||
}
|
||||
|
||||
char* strcpy(char* dest, const char *src)
|
||||
|
||||
Reference in New Issue
Block a user