From bd3f0b53639988f5d09f4ecc8be4e88a4c1a01f1 Mon Sep 17 00:00:00 2001 From: s1341 Date: Sun, 25 Aug 2019 17:22:06 +0300 Subject: [PATCH] Properly handle all NULL cases --- kitty/line.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/line.c b/kitty/line.c index dcd647e4c..ec6b3e08b 100644 --- a/kitty/line.c +++ b/kitty/line.c @@ -269,9 +269,12 @@ line_as_ansi(Line *self, Py_UCS4 *buf, index_type buflen, bool *truncated, GPUCe GPUCell blank_cell = { 0 }; GPUCell *cell, *temp_cell = &blank_cell; - if (prev_cell == NULL || *prev_cell == NULL) { + if (prev_cell == NULL) { prev_cell = &temp_cell; } + if (*prev_cell == NULL) { + *prev_cell = &blank_cell; + } for (index_type pos=0; pos < limit; pos++) { char_type ch = self->cpu_cells[pos].ch;