summaryrefslogtreecommitdiff
path: root/builtin-unpack-objects.c
diff options
context:
space:
mode:
authorEdgar Toernig <froese@gmx.de>2006-10-31 01:44:27 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-10-31 01:44:27 (GMT)
commit79a65697be00f3b53430930078a7d34b591d5070 (patch)
treee0c93e9491df2a8403dd5719577e65ebf54c1a1a /builtin-unpack-objects.c
parent6dcfa306f2b67b733a7eb2d7ded1bc9987809edb (diff)
downloadgit-79a65697be00f3b53430930078a7d34b591d5070.zip
git-79a65697be00f3b53430930078a7d34b591d5070.tar.gz
git-79a65697be00f3b53430930078a7d34b591d5070.tar.bz2
Use memmove instead of memcpy for overlapping areas
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-unpack-objects.c')
-rw-r--r--builtin-unpack-objects.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c
index e70a711..74a90c1 100644
--- a/builtin-unpack-objects.c
+++ b/builtin-unpack-objects.c
@@ -22,7 +22,7 @@ static SHA_CTX ctx;
* Make sure at least "min" bytes are available in the buffer, and
* return the pointer to the buffer.
*/
-static void * fill(int min)
+static void *fill(int min)
{
if (min <= len)
return buffer + offset;
@@ -30,7 +30,7 @@ static void * fill(int min)
die("cannot fill %d bytes", min);
if (offset) {
SHA1_Update(&ctx, buffer, offset);
- memcpy(buffer, buffer + offset, len);
+ memmove(buffer, buffer + offset, len);
offset = 0;
}
do {