aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-16 06:04:12 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-16 06:04:12 +0000
commit6f2cffd8c0949c2dfa1499c5d0c2594eb645ac26 (patch)
tree15fde45c9f1a9480336a07977103edc326a4d0f0
parentvt: ignore 0x7f (DEL) in ground state (diff)
vt: never call term_print() with a width <= 0
-rw-r--r--terminal.c3
-rw-r--r--vt.c3
2 files changed, 3 insertions, 3 deletions
diff --git a/terminal.c b/terminal.c
index 84c9d459..554aa8b2 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2401,8 +2401,7 @@ print_spacer(struct terminal *term, int col)
void
term_print(struct terminal *term, wchar_t wc, int width)
{
- if (unlikely(width <= 0))
- return;
+ assert(width > 0);
print_linewrap(term);
print_insert(term, width);
diff --git a/vt.c b/vt.c
index 148f2aae..f25f26be 100644
--- a/vt.c
+++ b/vt.c
@@ -663,7 +663,8 @@ action_utf8_print(struct terminal *term, wchar_t wc)
}
}
- term_print(term, wc, width);
+ if (width > 0)
+ term_print(term, wc, width);
}
static void