diff options
author | Mattias Andrée <maandree@kth.se> | 2024-09-13 19:38:45 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-09-13 19:38:45 +0200 |
commit | adea9377224a1fc8a79b00cd7d2891736129fd0f (patch) | |
tree | 2c065463d67f2b4c87ccf2f3daf0111b94b0d41b | |
parent | Fix exit value on usage error (diff) | |
download | git-rediff-1.0.2.tar.gz git-rediff-1.0.2.tar.bz2 git-rediff-1.0.2.tar.xz |
Fix segfault bug1.0.2
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | git-rediff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git-rediff.c b/git-rediff.c index 6ce75c2..75f043b 100644 --- a/git-rediff.c +++ b/git-rediff.c @@ -448,7 +448,7 @@ rediff_file(struct text *text_out, const struct text *text_in, const char *fname subhunk++; if ((size_t)subhunk == hunk.nsubs) hunk.subs = ereallocarray(hunk.subs, ++hunk.nsubs, sizeof(*hunk.subs)); - hunk.subs[subhunk].text.nlines = 0; + hunk.subs[subhunk].text = (struct text){0}; hunk.subs[subhunk].head = &text_in->lines[i]; } else if (line_startswith(&text_in->lines[i], ">>>>>>>")) { if (subhunk < 0) |