From 7d7602cea09692eddb6a8d16f7786b5086a01091 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 24 Jun 2017 13:26:01 +0300 Subject: [PATCH] Fix crashes on TTY frames due to negative lnum_width. --- src/xdisp.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.39.2