about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-09-06 20:28:42 -0400
committerRich Felker <dalias@aerifal.cx>2012-09-06 20:28:42 -0400
commitbac03cdde1137c16b4c194e137310e2748661dcc (patch)
tree1b4381083ce2e1e23a41645235383ac00035ce22 /src
parent594318fd3d13c7dda1ea87a76934e052ac74301f (diff)
downloadmusl-bac03cdde1137c16b4c194e137310e2748661dcc.tar.gz
musl-bac03cdde1137c16b4c194e137310e2748661dcc.tar.xz
musl-bac03cdde1137c16b4c194e137310e2748661dcc.zip
remove dependency of wmemmove on wmemcpy direction
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.
Diffstat (limited to 'src')
-rw-r--r--src/string/wmemmove.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/string/wmemmove.c b/src/string/wmemmove.c
index 49608cae..89041c32 100644
--- a/src/string/wmemmove.c
+++ b/src/string/wmemmove.c
@@ -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;
 }