summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 35eabd1)
raw | patch | inline | side by side (parent: 35eabd1)
author | Jeff King <peff@peff.net> | |
Fri, 29 Jan 2010 10:28:44 +0000 (05:28 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 29 Jan 2010 17:52:21 +0000 (09:52 -0800) |
Caught by valgrind in t5500, but it is pretty obvious from
reading the code that this is shifting elements of an array
to the left, which needs memmove.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reading the code that this is shifting elements of an array
to the left, which needs memmove.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c | patch | blob | history |
diff --git a/commit.c b/commit.c
index 6393e1b36218e5f8970b0c43092b07f5d94b0bce..a51d2cd1bed0c18b26f8f8123f1dab398a5019d8 100644 (file)
--- a/commit.c
+++ b/commit.c
if (pos < 0)
return -1;
if (pos + 1 < commit_graft_nr)
- memcpy(commit_graft + pos, commit_graft + pos + 1,
+ memmove(commit_graft + pos, commit_graft + pos + 1,
sizeof(struct commit_graft *)
* (commit_graft_nr - pos - 1));
commit_graft_nr--;