musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/string/wmemmove.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/wmemmove.c')
-rw-r--r--src/string/wmemmove.c 3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string/wmemmove.c b/src/string/wmemmove.c
index e406f3d5..d58cebac 100644
--- a/src/string/wmemmove.c
+++ b/src/string/wmemmove.c
@@ -1,9 +1,10 @@
#include <wchar.h>
+#include <stdint.h>
wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n)
{
wchar_t *d0 = d;
- if ((size_t)(d-s) < n)
+ if ((uintptr_t)d-(uintptr_t)s < n * sizeof *d)
while (n--) d[n] = s[n];
else
while (n--) *d++ = *s++;
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月08日 06:14:01 +0000

AltStyle によって変換されたページ (->オリジナル) /