OSDN Git Service

Base bcopy on memmove rather than memcpy.
authorRohit Agrawal <rohitagr@google.com>
Sat, 5 Dec 2015 20:39:54 +0000 (12:39 -0800)
committerRohit Agrawal <rohitagr@google.com>
Mon, 7 Dec 2015 21:06:14 +0000 (13:06 -0800)
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

index 5964c63..0429430 100644 (file)
@@ -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.