Skip to content

Commit

Permalink
git-diff: fix combined diff
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dscho authored and Junio C Hamano committed Feb 23, 2007
1 parent 755b99d commit 75b62b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin-diff.c
Expand Up @@ -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;
Expand Down

0 comments on commit 75b62b4

Please sign in to comment.