aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-12 00:19:41 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-12 00:19:41 +0000
commit0b30316261867fdf79f6b847ba4965e1d787adcd (patch)
tree01169b68a7d17fe823b9a385a6c002ef10d3b7d9
parentMerge branch 'switch-based-keymap-lookup' (diff)
render: don't bother trying to lookup glyph for empty cells
Depending on the font, it may not have an entry for code point '0', which will cause us to try to load fallback fonts.
-rw-r--r--render.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/render.c b/render.c
index 3dd901be..5f2aff69 100644
--- a/render.c
+++ b/render.c
@@ -417,7 +417,8 @@ render_cell(struct terminal *term, pixman_image_t *pix,
}
struct font *font = attrs_to_font(term, &cell->attrs);
- const struct glyph *glyph = font_glyph_for_wc(font, cell->wc);
+ const struct glyph *glyph = cell->wc != 0
+ ? font_glyph_for_wc(font, cell->wc) : NULL;
int cell_cols = glyph != NULL ? max(1, glyph->cols) : 1;