From 2754fa8772d477d2da135040411e04c5e614145e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 22 Mar 2008 18:13:42 +0000 Subject: [PATCH] bcopy() is supposed to be overlap-save. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24525 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/string.h | 2 +- src/system/libroot/posix/string/bcopy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/posix/string.h b/headers/posix/string.h index b5b918f9c7..bc1b61f5ac 100644 --- a/headers/posix/string.h +++ b/headers/posix/string.h @@ -75,7 +75,7 @@ extern const char *strsignal(int signal); /* legacy compatibility -- might be removed one day */ #define bcmp(a, b, length) memcmp((a), (b), (length)) -#define bcopy(source, dest, length) memcpy((dest), (source), (length)) +#define bcopy(source, dest, length) memmove((dest), (source), (length)) #define bzero(buffer, length) memset((buffer), 0, (length)) extern int ffs(int i); diff --git a/src/system/libroot/posix/string/bcopy.c b/src/system/libroot/posix/string/bcopy.c index 589e88bd36..ff5e4367a7 100644 --- a/src/system/libroot/posix/string/bcopy.c +++ b/src/system/libroot/posix/string/bcopy.c @@ -16,6 +16,6 @@ void *bcopy(void const *src, void *dest, size_t count); void * bcopy(void const *src, void *dest, size_t count) { - return memcpy(dest, src, count); + return memmove(dest, src, count); }