From e56523f326a8c883b582d9cf5e25b0f48f9783dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 10 Feb 2020 22:40:16 +0100 Subject: [PATCH] render: resize: calculated cursor row *should* never be beyond the screen bottom --- render.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/render.c b/render.c index 9218527e..4aac652a 100644 --- a/render.c +++ b/render.c @@ -1229,9 +1229,10 @@ maybe_resize(struct terminal *term, int width, int height, bool force) cursor_row += term->grid->num_rows; cursor_row--; + assert(cursor_row < term->rows); term_cursor_to( term, - min(max(cursor_row, 0), term->rows - 1), + max(cursor_row, 0), min(term->cursor.point.col, term->cols - 1)); term->render.last_cursor.cell = NULL;