about 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.c2
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) {