From: Eli Zaretskii Date: Sat, 24 Jun 2017 10:26:01 +0000 (+0300) Subject: Fix crashes on TTY frames due to negative lnum_width. X-Git-Tag: emacs-26.0.90~518^2~156^2~31 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d7602cea09692eddb6a8d16f7786b5086a01091;p=emacs.git Fix crashes on TTY frames due to negative lnum_width. --- diff --git a/src/xdisp.c b/src/xdisp.c index 19e3efb2f3d..f98e7a9ac7e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20770,6 +20770,7 @@ maybe_produce_line_number (struct it *it) else max_lnum = this_line + it->w->desired_matrix->nrows - 1 - it->vpos; + max_lnum = max (1, max_lnum); it->lnum_width = log10 (max_lnum) + 1; } eassert (it->lnum_width > 0);