aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-02-23 05:20:32 +0100
committerJunio C Hamano <junkio@cox.net>2007-02-22 21:24:34 -0800
commit75b62b489af7b62a5518c3f199d2a2776205e088 (patch)
treefb7ee6d079c4b286102175d6cdec938159614bed
parent755b99d81539461645088085ea033a3b36152da5 (diff)
downloadgit-75b62b489af7b62a5518c3f199d2a2776205e088.tar.gz
git-75b62b489af7b62a5518c3f199d2a2776205e088.tar.xz
git-diff: fix combined diff
The code forgets that typecast binds tighter than addition, in other words: (cast *)array + i === ((cast *)array) + i Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--builtin-diff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index a6590205e..c387ebb16 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -192,7 +192,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;