1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:17:35 +00:00

LibC: Implement wmemmove

This commit is contained in:
Tim Schumacher 2021-09-22 10:24:12 +00:00 committed by Brian Gianforcaro
parent fa1208edfd
commit 05b283f552
3 changed files with 42 additions and 0 deletions

View file

@ -402,4 +402,19 @@ wchar_t* wmemset(wchar_t* wcs, wchar_t wc, size_t n)
return wcs;
}
wchar_t* wmemmove(wchar_t* dest, const wchar_t* src, size_t n)
{
if (dest > src) {
for (size_t i = 1; i <= n; i++) {
dest[n - i] = src[n - i];
}
} else if (dest < src) {
for (size_t i = 0; i < n; i++) {
dest[i] = src[i];
}
}
return dest;
}
}