projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
594318f
)
remove dependency of wmemmove on wmemcpy direction
author
Rich Felker
<dalias@aerifal.cx>
Fri, 7 Sep 2012 00:28:42 +0000
(20:28 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 7 Sep 2012 00:28:42 +0000
(20:28 -0400)
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.
src/string/wmemmove.c
patch
|
blob
|
history
diff --git
a/src/string/wmemmove.c
b/src/string/wmemmove.c
index 49608caed57ed6de8a552ce34d9bbd73ff186ac1..89041c32ae28ad29847ed720a9b75944e85b7c80 100644
(file)
--- 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
;
}