diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2025-01-18 09:22:24 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-01-18 09:22:24 +0000 |
| commit | 22e1b1610f622ca9e2a7e64593025a8d44bc7b14 (patch) | |
| tree | 854d8c52c872f06cc85f59dde5ee33940caf2f6f /vt.c | |
| parent | Merge branch 'releases/1.20' (diff) | |
vt: combining chars: ensure 'key' is within range
When there's a key collision, we increment the key and check
again. When doing this, we need to ensure the key is withing range,
and wrap around to 0 if the key value is too large.
Diffstat (limited to 'vt.c')
| -rw-r--r-- | vt.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -845,6 +845,7 @@ action_utf8_print(struct terminal *term, char32_t wc) cc->chars[0], base, cc->count, wanted_count, cc->chars[wanted_count - 1], wc); #endif key++; + key &= CELL_COMB_CHARS_HI - CELL_COMB_CHARS_LO; collision_count++; continue; } @@ -856,6 +857,7 @@ action_utf8_print(struct terminal *term, char32_t wc) if (!match) { key++; + key &= CELL_COMB_CHARS_HI - CELL_COMB_CHARS_LO; collision_count++; continue; } |
