Fix unsafe use of SDATA in 'display_tty_menu_separator'

* src/xdisp.c (display_tty_menu_separator): Pass Lisp string to
display_string, not a pointer to its SDATA.  This is safer
GC-wise.
This commit is contained in:
Eli Zaretskii 2026-04-21 15:49:07 +03:00
parent c1fbe7c408
commit ccb454f28c

View file

@ -27765,7 +27765,7 @@ display_tty_menu_separator (struct it *it, const char *label, int width)
else else
c = display_tty_menu_separator_char ('-', BOX_HORIZONTAL); c = display_tty_menu_separator_char ('-', BOX_HORIZONTAL);
Lisp_Object sep = Fmake_string (make_fixnum (width - 1), make_fixnum (c), Qt); Lisp_Object sep = Fmake_string (make_fixnum (width - 1), make_fixnum (c), Qt);
display_string ((char *) SDATA (sep), Qnil, Qnil, 0, 0, it, width, -1, -1, 1); display_string ((char *) SDATA (sep), sep, Qnil, 0, 0, it, width, -1, -1, 1);
} }
/* Display one menu item on a TTY, by overwriting the glyphs in the /* Display one menu item on a TTY, by overwriting the glyphs in the