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/memmove.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/memmove.c')
-rw-r--r--src/string/memmove.c 2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string/memmove.c b/src/string/memmove.c
index 27f670e1..f225bb30 100644
--- a/src/string/memmove.c
+++ b/src/string/memmove.c
@@ -10,7 +10,7 @@ void *memmove(void *dest, const void *src, size_t n)
const char *s = src;
if (d==s) return d;
- if (s+n <= d || d+n <= s) return memcpy(d, s, n);
+ if ((uintptr_t)s-(uintptr_t)d-n <= -2*n) return memcpy(d, s, n);
if (d<s) {
if ((uintptr_t)s % WS == (uintptr_t)d % WS) {
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月09日 09:26:22 +0000

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