![]() |
|
Message-ID: <20250330121748.699050-2-cgoettsche@seltendoof.de> Date: Sun, 30 Mar 2025 14:17:36 +0200 From: Christian Göttsche <cgoettsche@...tendoof.de> To: musl@...ts.openwall.com Cc: Christian Göttsche <cgzones@...glemail.com> Subject: [PATCH 2/4] wmemcpy: implement via memcpy() From: Christian Göttsche <cgzones@...glemail.com> Implement via memcpy() to inherit its optimizations. --- src/string/wmemcpy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/string/wmemcpy.c b/src/string/wmemcpy.c index 52e6e6e0..e68fdf49 100644 --- a/src/string/wmemcpy.c +++ b/src/string/wmemcpy.c @@ -1,8 +1,7 @@ #include <wchar.h> +#include <string.h> wchar_t *wmemcpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) { - wchar_t *a = d; - while (n--) *d++ = *s++; - return a; + return memcpy(d, s, n * sizeof(wchar_t)); } -- 2.49.0
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.