From 47d6dd0eeef6b3153a3989c76044f2cb091b12d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 16 Jul 2020 08:06:37 +0200 Subject: [PATCH] csi: never call term_print() with width <= 0 --- csi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/csi.c b/csi.c index fc6db974..fe102ada 100644 --- a/csi.c +++ b/csi.c @@ -338,8 +338,10 @@ csi_dispatch(struct terminal *term, uint8_t final) LOG_DBG("REP: '%C' %d times", term->vt.last_printed, count); const int width = wcwidth(term->vt.last_printed); - for (int i = 0; i < count; i++) - term_print(term, term->vt.last_printed, width); + if (width > 0) { + for (int i = 0; i < count; i++) + term_print(term, term->vt.last_printed, width); + } } break;