From: Johannes Schindelin Date: Fri, 23 Feb 2007 04:20:32 +0000 (+0100) Subject: git-diff: fix combined diff X-Git-Tag: v1.5.0.2~15 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=75b62b489af7b62a5518c3f199d2a2776205e088;p=git.git 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 Signed-off-by: Junio C Hamano --- 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;