Git development
 help / color / mirror / Atom feed
* [PATCH] git-diff: fix combined diff
@ 2007-02-23  4:20 Johannes Schindelin
  2007-02-23  5:22 ` Junio C Hamano
  2007-02-23  5:34 ` Jeff King
  0 siblings, 2 replies; 5+ messages in thread
From: Johannes Schindelin @ 2007-02-23  4:20 UTC (permalink / raw)
  To: git, junkio


With "const unsigned (*parent)[20]", "parent + 1" is not the
same as "&parent[1]"...

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---

	I triggered this bug by "git diff a...b", where a and b
	have 4 merge bases. I am really too tired to add a test
	case, though...

 builtin-diff.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin-diff.c b/builtin-diff.c
index 9334589..846cafb 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -158,7 +158,8 @@ static int builtin_diff_combined(struct rev_info *revs,
 	parent = xmalloc(ents * sizeof(*parent));
 	/* Again, the revs are all reverse */
 	for (i = 0; i < ents; i++)
-		hashcpy((unsigned char*)parent + i, ent[ents - 1 - i].item->sha1);
+		hashcpy((unsigned char*)&parent[i],
+				ent[ents - 1 - i].item->sha1);
 	diff_tree_combined(parent[0], parent + 1, ents - 1,
 			   revs->dense_combined_merges, revs);
 	return 0;
-- 
1.5.0.1.2218.g2de79

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-23 11:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-23  4:20 [PATCH] git-diff: fix combined diff Johannes Schindelin
2007-02-23  5:22 ` Junio C Hamano
2007-02-23  6:09   ` Junio C Hamano
2007-02-23  5:34 ` Jeff King
2007-02-23 11:19   ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox