summaryrefslogtreecommitdiff
path: root/combine-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'combine-diff.c')
-rw-r--r--combine-diff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/combine-diff.c b/combine-diff.c
index f6b624dc28..33d0ed7097 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -1185,7 +1185,8 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
result_file.ptr = result;
result_file.size = result_size;
- /* Even p_lno[cnt+1] is valid -- that is for the end line number
+ /*
+ * Even p_lno[cnt+1] is valid -- that is for the end line number
* for deletion hunk at the end.
*/
CALLOC_ARRAY(sline[0].p_lno, st_mult(st_add(cnt, 2), num_parent));
@@ -1220,7 +1221,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
}
free(result);
- for (lno = 0; lno < cnt; lno++) {
+ for (lno = 0; lno < cnt + 2; lno++) {
if (sline[lno].lost) {
struct lline *ll = sline[lno].lost;
while (ll) {