Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit 6f2cffd

Browse files
committed
vt: never call term_print() with a width <= 0
1 parent 9508804 commit 6f2cffd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

terminal.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -2401,8 +2401,7 @@ print_spacer(struct terminal *term, int col)
24012401
void
24022402
term_print(struct terminal *term, wchar_t wc, int width)
24032403
{
2404-
if (unlikely(width <= 0))
2405-
return;
2404+
assert(width > 0);
24062405

24072406
print_linewrap(term);
24082407
print_insert(term, width);

vt.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,8 @@ action_utf8_print(struct terminal *term, wchar_t wc)
663663
}
664664
}
665665

666-
term_print(term, wc, width);
666+
if (width > 0)
667+
term_print(term, wc, width);
667668
}
668669

669670
static void

0 commit comments

Comments
 (0)