wmemmove.c 263 B

12345678910111213
  1. #include <wchar.h>
  2. #include <stdint.h>
  3. wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n)
  4. {
  5. wchar_t *d0 = d;
  6. if (d == s) return d;
  7. if ((uintptr_t)d-(uintptr_t)s < n * sizeof *d)
  8. while (n--) d[n] = s[n];
  9. else
  10. while (n--) *d++ = *s++;
  11. return d0;
  12. }