From adea9377224a1fc8a79b00cd7d2891736129fd0f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 13 Sep 2024 19:38:45 +0200 Subject: Fix segfault bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- git-rediff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3-70-g09d2