From d11a71e0b221cc24404da37ea928708a03d65c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 14 Feb 2020 22:43:23 +0100 Subject: [PATCH] term: reset: use grid_row_alloc() with initialize=true This will both zero out the cells, *and* re-initialize the row properties correctly. --- terminal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terminal.c b/terminal.c index b2fb9233..bec0ce7b 100644 --- a/terminal.c +++ b/terminal.c @@ -1090,8 +1090,8 @@ term_reset(struct terminal *term, bool hard) term->normal.offset = term->normal.view = 0; term->alt.offset = term->alt.view = 0; for (size_t i = 0; i < term->rows; i++) { - memset(grid_row_and_alloc(&term->normal, i)->cells, 0, term->cols * sizeof(struct cell)); - memset(grid_row_and_alloc(&term->alt, i)->cells, 0, term->cols * sizeof(struct cell)); + term->normal.rows[i] = grid_row_alloc(term->cols, true); + term->alt.rows[i] = grid_row_alloc(term->cols, true); } for (size_t i = term->rows; i < term->normal.num_rows; i++) { grid_row_free(term->normal.rows[i]);