library: move check for valid UTF-8 after de-escaping

CODE128: fix bad index 0 -> i in `c128_glyph_count()`
This commit is contained in:
gitlost 2024-10-30 16:37:42 +00:00
parent 7e6da28761
commit 71b2dc50b7
5 changed files with 51 additions and 49 deletions

View file

@ -346,7 +346,7 @@ static int c128_glyph_count(const unsigned char source[], const int length, cons
for (i = 0; i < length; i++) {
if (set[i] != current_set) {
/* Latch different code set */
switch (set[0]) {
switch (set[i]) {
case 'A':
case 'b': /* Manual switching can cause immediate shift */
if (current_set != 'A') {