fix(mbyte): fix bugs in utf_cp_*_off() functions

Problems:
- Illegal bytes after valid UTF-8 char cause utf_cp_*_off() to fail.
- When stream isn't NUL-terminated, utf_cp_*_off() may go over the end.
Solution: Don't go over end of the char of end of the string.
This commit is contained in:
VanaIgr
2024-02-26 04:12:55 -06:00
committed by GitHub
parent 8b4e269156
commit ad5a155b1f
9 changed files with 134 additions and 93 deletions

View File

@@ -203,7 +203,8 @@ information.
mb_off2cells utf_off2cells
mb_ptr2char utf_ptr2char
mb_head_off utf_head_off
mb_tail_off utf_cp_tail_off
mb_tail_off utf_cp_bounds
mb_off_next utf_cp_bounds
mb_lefthalve grid_lefthalve
mb_fix_col grid_fix_col
utf_off2cells grid_off2cells