Make sure that the charcode is signless

1. The data with type of char is signed by default.

2. The byte value of UTF-8 is signless by default.

3. So, if a UTF-8 charcode is stored in a char array, we should cast the
type of its value from char to unsigned char.
This commit is contained in:
liiulinsong
2023-05-26 10:18:58 +08:00
parent c00f1a96c8
commit 6dc75b46cc

View File

@ -373,7 +373,7 @@ _gtk_css_parser_read_char (GtkCssParser *parser,
parser->data++;
return TRUE;
}
if (*parser->data >= 127)
if ((*(guchar *) parser->data) >= 127)
{
gsize len = g_utf8_skip[(guint) *(guchar *) parser->data];