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.
This commit is contained in:
Daniel Eklöf 2019-07-10 18:47:32 +02:00
parent cf71534768
commit b1f8dd75d6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 3 additions and 3 deletions

2
vt.c
View file

@ -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;