mirror of
https://github.com/fluencelabs/musl
synced 2025-06-28 14:11:56 +00:00
unlike the memmove commit, this one should be fine to leave in place. wmemmove is not performance-critical, and even if it were, it's already copying whole 32-bit words at a time instead of bytes.
12 lines
197 B
C
12 lines
197 B
C
#include <string.h>
|
|
#include <wchar.h>
|
|
|
|
wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n)
|
|
{
|
|
if ((size_t)(d-s) < n)
|
|
while (n--) d[n] = s[n];
|
|
else
|
|
while (n--) *d++ = *s++;
|
|
return d;
|
|
}
|