1
0
mirror of https://github.com/irssi/irssi.git synced 2024-07-21 03:14:16 -04:00

Merge pull request #1183 from ailin-nemui/glib-2-63

manually handle NUL unicode in g_utf8_get_next_char_validated
This commit is contained in:
ailin-nemui 2020-07-08 17:43:11 +02:00 committed by GitHub
commit 76802985a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -672,7 +672,11 @@ void term_stop(void)
static int input_utf8(const unsigned char *buffer, int size, unichar *result)
{
unichar c = g_utf8_get_char_validated((char *)buffer, size);
unichar c = g_utf8_get_char_validated((char *) buffer, size);
/* GLib >= 2.63 do not accept Unicode NUL anymore */
if (c == (unichar) -2 && *buffer == 0 && size > 0)
c = 0;
switch (c) {
case (unichar)-1: