diff options
author | Maks Naumov <maksqwe1@ukr.net> | 2015-01-11 11:27:37 -0800 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-01-11 15:46:06 -0500 |
commit | 87d36885ac713badc5187f1d26044dbba9e13309 (patch) | |
tree | af468fc95dcd1cf5b67773736afc74a23c225c1c /modules | |
parent | 07cf489d2df1fd8e71bfbf8a027876490e6858c6 (diff) | |
download | gtk+-87d36885ac713badc5187f1d26044dbba9e13309.tar.gz |
Properly check result of g_utf8_get_char_validated()
g_utf8_get_char_validated() may return -1 or -2
return type is gunichar(guint32)
Therefore such checks like 'gunichar < 0' or 'gunichar > 0'
are always 'false' or 'true'(except when gunichar == 0).
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
https://bugzilla.gnome.org/show_bug.cgi?id=742774
Diffstat (limited to 'modules')
-rw-r--r-- | modules/input/gtkimcontextthai.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/input/gtkimcontextthai.c b/modules/input/gtkimcontextthai.c index 254dfc78fc..73510c0360 100644 --- a/modules/input/gtkimcontextthai.c +++ b/modules/input/gtkimcontextthai.c @@ -195,7 +195,7 @@ get_previous_char (GtkIMContextThai *context_thai, gint offset) if (offset == 0) { prev_char = g_utf8_get_char_validated (q, p - q); - if (prev_char < 0) + if (prev_char == (gunichar)-1 || prev_char == (gunichar)-2) prev_char = 0; } g_free (surrounding); |