diff options
author | Mattias Andrée <maandree@kth.se> | 2024-08-15 21:00:50 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-08-15 21:00:50 +0200 |
commit | c5a1c5813d2848faa19f28b225f332b22319c776 (patch) | |
tree | 80a12d0ff0e75bf4126503436f116a85c49693e9 | |
parent | Fix typo (diff) | |
download | git-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.c | 3 |
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); |