mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 18:07:35 +00:00
LibC: Implement wmemmove
This commit is contained in:
parent
fa1208edfd
commit
05b283f552
3 changed files with 42 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,5 +46,6 @@ wchar_t* wcsstr(const wchar_t*, const wchar_t*);
|
|||
wchar_t* wmemchr(const wchar_t*, wchar_t, size_t);
|
||||
wchar_t* wmemcpy(wchar_t*, const wchar_t*, size_t);
|
||||
wchar_t* wmemset(wchar_t*, wchar_t, size_t);
|
||||
wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t);
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue