From d51a0b0f9da767d5d67c9f3565c34afcaab1a908 Mon Sep 17 00:00:00 2001 From: Rohit Agrawal Date: Sat, 5 Dec 2015 12:39:54 -0800 Subject: [PATCH] Base bcopy on memmove rather than memcpy. POSIX defined bcopy to handle overlapping memory akin to memmove and bionic appears to have always done so. Change-Id: I2599113411e3532913270ba1c1b49e35cbc5f106 --- libc/bionic/ndk_cruft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index 5964c6375..042943005 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -247,7 +247,7 @@ sighandler_t bsd_signal(int signum, sighandler_t handler) { // This was removed from POSIX 2008. #undef bcopy void bcopy(const void* src, void* dst, size_t n) { - memcpy(dst, src, n); + memmove(dst, src, n); } #else // x86 has an assembler implementation.