diff --git a/src/intl/charsets.c b/src/intl/charsets.c index ecbc7b27..c7a58fc8 100644 --- a/src/intl/charsets.c +++ b/src/intl/charsets.c @@ -663,7 +663,7 @@ utf8_to_unicode(unsigned char **string, const unsigned char *end) 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 8e77a321..074e5dfb 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 @@ + + + + + + + +