remove dependency of wmemmove on wmemcpy direction
[musl] / src / string / wmemmove.c
index 49608ca..89041c3 100644 (file)
@@ -3,9 +3,9 @@
 
 wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n)
 {
-       if ((size_t)(d-s) < n) {
+       if ((size_t)(d-s) < n)
                while (n--) d[n] = s[n];
-               return d;
-       }
-       return wmemcpy(d, s, n);
+       else
+               while (n--) *d++ = *s++;
+       return d;
 }