summaryrefslogtreecommitdiff
path: root/src/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/text.c b/src/text.c
index c68011f..07ade9d 100644
--- a/src/text.c
+++ b/src/text.c
@@ -343,6 +343,12 @@ void term_text_repeat(struct term *t, int count)
{
int screen = t->cols * t->rows;
if (count > screen) count = screen;
+ if (count <= 0 || !t->last_char)
+ return;
+ if (count == 1) {
+ term_sc_print_glyph(t, t->last_char, -1, term_current_flags(t));
+ return;
+ }
for (int j = 0; j < count && t->last_char; j++)
term_sc_print_glyph(t, t->last_char, -1, term_current_flags(t));
}