mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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.
This commit is contained in:
parent
10c4e94e1b
commit
22e1b1610f
1 changed files with 2 additions and 0 deletions
2
vt.c
2
vt.c
|
|
@ -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);
|
cc->chars[0], base, cc->count, wanted_count, cc->chars[wanted_count - 1], wc);
|
||||||
#endif
|
#endif
|
||||||
key++;
|
key++;
|
||||||
|
key &= CELL_COMB_CHARS_HI - CELL_COMB_CHARS_LO;
|
||||||
collision_count++;
|
collision_count++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -856,6 +857,7 @@ action_utf8_print(struct terminal *term, char32_t wc)
|
||||||
|
|
||||||
if (!match) {
|
if (!match) {
|
||||||
key++;
|
key++;
|
||||||
|
key &= CELL_COMB_CHARS_HI - CELL_COMB_CHARS_LO;
|
||||||
collision_count++;
|
collision_count++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue