aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-10 16:47:32 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-10 16:47:32 +0000
commitb1f8dd75d684b3dd00f147a63ef687a6b566fc7f (patch)
tree354ae58f2fe2ebe3199656cdd7f9e011ee812ed3 /render.c
parentterminal: remove 'blink' attribute from cell struct (diff)
cell: we only need 4 bytes for the longest utf8 sequence
We don't *have* to NULL-terminate the utf8 string. So don't. This makes the cell glyph 4 bytes exactly, which is better for alignment and cache usage.
Diffstat (limited to 'render.c')
-rw-r--r--render.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/render.c b/render.c
index 65e2ab96..894bc939 100644
--- a/render.c
+++ b/render.c
@@ -101,7 +101,7 @@ render_cell(struct terminal *term, struct buffer *buf, const struct cell *cell,
cairo_status_t status = cairo_scaled_font_text_to_glyphs(
attrs_to_font(term, &cell->attrs), x, y + term->fextents.ascent,
- cell->c, strlen(cell->c), &gseq.g, &new_glyphs,
+ cell->c, strnlen(cell->c, 4), &gseq.g, &new_glyphs,
NULL, NULL, NULL);
if (status != CAIRO_STATUS_SUCCESS)