From 076096db29da41161b44e3b7419ef3afb9a7b416 Mon Sep 17 00:00:00 2001 From: cancel Date: Fri, 14 Dec 2018 08:25:18 +0900 Subject: [PATCH] Cleanup --- tui_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tui_main.c b/tui_main.c index f5f6d3b..6c7064d 100644 --- a/tui_main.c +++ b/tui_main.c @@ -460,10 +460,11 @@ void draw_glyphs_grid(WINDOW* win, int draw_y, int draw_x, int draw_h, Usz cols = (Usz)(draw_w - draw_x); if (field_w - offset_x < cols) cols = field_w - offset_x; + if (Bufcount < cols) + cols = Bufcount; if (rows == 0 || cols == 0) return; bool use_rulers = ruler_spacing_y != 0 && ruler_spacing_x != 0; - (void)use_rulers; for (Usz iy = 0; iy < rows; ++iy) { Usz line_offset = (offset_y + iy) * field_w + offset_x; Glyph const* g_row = gbuffer + line_offset;