From e460866ebc1c43199c78035f951ad56c3fbbd898 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 30 Oct 2018 15:02:48 +0530 Subject: [PATCH] Make the bounds check cleaner --- kitty/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/screen.c b/kitty/screen.c index 16390d681..0c1c17da3 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -366,7 +366,7 @@ draw_combining_char(Screen *self, char_type ch) { CPUCell *cpu_cell = self->linebuf->line->cpu_cells + xpos; GPUCell *gpu_cell = self->linebuf->line->gpu_cells + xpos; if ((gpu_cell->attrs & WIDTH_MASK) != 2 && cpu_cell->cc_idx[0] == VS16 && is_emoji_presentation_base(cpu_cell->ch)) { - if (xpos < self->columns - 1) line_set_char(self->linebuf->line, self->cursor->x, 0, 0, self->cursor, true); + if (self->cursor->x <= self->columns - 1) line_set_char(self->linebuf->line, self->cursor->x, 0, 0, self->cursor, true); gpu_cell->attrs = (gpu_cell->attrs & !WIDTH_MASK) | 2; if (xpos == self->columns - 1) move_widened_char(self, cpu_cell, gpu_cell, xpos, ypos); else self->cursor->x++;