]> git.eshelyaron.com Git - emacs.git/commitdiff
; * src/xdisp.c (maybe_produce_line_number): Fix last change (bug#76362).
authorEli Zaretskii <eliz@gnu.org>
Mon, 17 Feb 2025 16:00:30 +0000 (18:00 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 18 Feb 2025 08:53:03 +0000 (09:53 +0100)
(cherry picked from commit 1136963b4e81e2b3efd42f3bd609bf968d05831f)

src/xdisp.c

index 7d856fcf4c171ded2c2c1357c6a5551cd36eedbc..48229c0e069eeb4d1d9f9919a80f2b9041a38cc9 100644 (file)
@@ -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))