diff --git a/src/intl/charsets.c b/src/intl/charsets.c index c02f2ed7..125e97c2 100644 --- a/src/intl/charsets.c +++ b/src/intl/charsets.c @@ -657,13 +657,13 @@ unicode_fold_label_case(unicode_val_T c) NONSTATIC_INLINE unicode_val_T utf8_to_unicode(char **string, const char *end) { - char *str = *string; + unsigned char *str = (unsigned char *)*string; unicode_val_T u; int length; - length = utf8char_len_tab[(unsigned char)str[0]]; + length = utf8char_len_tab[str[0]]; - if (str + length > end) { + if (str + length > (const unsigned char *)end) { return UCS_NO_CHAR; } @@ -734,7 +734,7 @@ invalid_utf8: INTERNAL("utf8char_len_tab out of range"); goto invalid_utf8; } - *string = str + length; + *string = (char *)(str + length); return u; } diff --git a/src/viewer/text/form.c b/src/viewer/text/form.c index e82fec99..7be02080 100644 --- a/src/viewer/text/form.c +++ b/src/viewer/text/form.c @@ -625,7 +625,7 @@ drew_char: data = utf8_to_unicode(&s, end); cell = unicode_to_cell(data); - if (i + 1 < len && cell == 2) { + if (i - 1 < len && cell == 2) { draw_char_data(term, x++, y, data); data = UCS_NO_CHAR; diff --git a/test/select.html b/test/select.html new file mode 100644 index 00000000..a6f1dc50 --- /dev/null +++ b/test/select.html @@ -0,0 +1,8 @@ + + + + + + + +