diff --git a/stagit.c b/stagit.c
index 638e58c..e3c921d 100644
--- a/stagit.c
+++ b/stagit.c
@@ -394,7 +394,7 @@ printshowfile(FILE *fp, struct commitinfo *ci)
if (git_patch_get_hunk(&hunk, &nhunklines, patch, j))
break;
- fprintf(fp, "", j, j);
+ fprintf(fp, "", i, j, i, j);
xmlencode(fp, hunk->header, hunk->header_len);
fputs("", fp);
@@ -402,11 +402,11 @@ printshowfile(FILE *fp, struct commitinfo *ci)
if (git_patch_get_line_in_hunk(&line, patch, j, k))
break;
if (line->old_lineno == -1)
- fprintf(fp, "+",
- j, k, j, k);
+ fprintf(fp, "+",
+ i, j, k, i, j, k);
else if (line->new_lineno == -1)
- fprintf(fp, "-",
- j, k, j, k);
+ fprintf(fp, "-",
+ i, j, k, i, j, k);
else
fputc(' ', fp);
xmlencode(fp, line->content, line->content_len);