From b1f8dd75d684b3dd00f147a63ef687a6b566fc7f Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 10 Jul 2019 18:47:32 +0200 Subject: 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. --- vt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vt.c') diff --git a/vt.c b/vt.c index 8314c060..5d4127c5 100644 --- a/vt.c +++ b/vt.c @@ -757,7 +757,7 @@ action_print(struct terminal *term, uint8_t c) if (unlikely(term->charset[term->selected_charset] == CHARSET_GRAPHIC) && c >= 0x41 && c <= 0x7e) { - strcpy(cell->c, vt100_0[c - 0x41]); + strncpy(cell->c, vt100_0[c - 0x41], sizeof(cell->c)); } else { //LOG_DBG("print: ASCII: %c", c); cell->c[0] = c; -- cgit v1.3