From 330fd96213da324f9164081df9a5226790d7c4ec Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 21 Feb 2013 23:19:18 -0500 Subject: [PATCH] fix wrong return value from wmemmove on forward copies --- src/string/wmemmove.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/string/wmemmove.c b/src/string/wmemmove.c index 89041c32..cde4feec 100644 --- a/src/string/wmemmove.c +++ b/src/string/wmemmove.c @@ -3,9 +3,10 @@ wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n) { + wchar_t *d0 = d; if ((size_t)(d-s) < n) while (n--) d[n] = s[n]; else while (n--) *d++ = *s++; - return d; + return d0; } -- 2.25.1