Alex Henrie alexhenrie24@gmail.com wrote:
+static inline wchar_t* __cdecl wmemmove(wchar_t *dst, const wchar_t *src, size_t n) +{
- size_t i;
- if (dst <= src) return wmemcpy(dst, src, n);
- for (i = 1; i <= n; i++)
dst[n - i] = src[n - i];
- return dst;
+}
The optimization with wmemcpy() looks arbitrary and not safe. Why not simply call memmove(dst, src, n * sizeof(wchar_t)) ?
Shouldn't wmemcpy() implementation also simply call memcpy() in a similar way?