mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:27:35 +00:00
LibC: Support backwards copy in memmove().
This commit is contained in:
parent
84c4110a50
commit
c7ded89f05
1 changed files with 6 additions and 2 deletions
|
@ -141,8 +141,12 @@ void* memmove(void* dest, const void* src, size_t n)
|
||||||
{
|
{
|
||||||
if (dest < src)
|
if (dest < src)
|
||||||
return memcpy(dest, src, n);
|
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)
|
char* strcpy(char* dest, const char *src)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue