From 37eb34a1e2af97fc35fe3488b17a93357880b3cf Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 17 Feb 2025 18:00:30 +0200 Subject: [PATCH] ; * src/xdisp.c (maybe_produce_line_number): Fix last change (bug#76362). (cherry picked from commit 1136963b4e81e2b3efd42f3bd609bf968d05831f) --- src/xdisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 7d856fcf4c1..48229c0e069 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25067,7 +25067,8 @@ maybe_produce_line_number (struct it *it) eassert (it->lnum_width > 0); } /* Extra +2 for the two blanks we add before and after the number. */ - char *lnum_buf = alloca (it->lnum_width + 2 + 1); + char *lnum_buf = alloca (max (it->lnum_width, INT_STRLEN_BOUND (ptrdiff_t)) + + 2 + 1); if (EQ (Vdisplay_line_numbers, Qrelative)) lnum_offset = it->pt_lnum; else if (EQ (Vdisplay_line_numbers, Qvisual)) -- 2.39.5