aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-08-15 21:00:50 +0200
committerMattias Andrée <maandree@kth.se>2024-08-15 21:00:50 +0200
commitc5a1c5813d2848faa19f28b225f332b22319c776 (patch)
tree80a12d0ff0e75bf4126503436f116a85c49693e9
parentFix typo (diff)
downloadgit-rediff-1.0.tar.gz
git-rediff-1.0.tar.bz2
git-rediff-1.0.tar.xz
Fix bug1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--git-rediff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-rediff.c b/git-rediff.c
index 009565c..c34e854 100644
--- a/git-rediff.c
+++ b/git-rediff.c
@@ -263,7 +263,8 @@ diff_subhunks(const struct subhunk *f1, const struct subhunk *f2)
if (waitpid(piddiff, &status, 0) != piddiff)
eprintf("waitpid <diff(1) subprocess> 0:");
if (status == 0) {
- ret = erealloc(ret, f1->text.nlines + 1U);
+ ret_off = f1->text.nlines;
+ ret = erealloc(ret, ret_off + 1U);
memset(ret, ' ', f1->text.nlines);
} else if (WIFEXITED(status) && WEXITSTATUS(status) == 1) {
ret = erealloc(ret, ret_off + 1U);