summaryrefslogtreecommitdiff
path: root/src/gui/gui-chat.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-06-12 08:00:44 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-06-12 08:00:44 +0200
commitae23fb0b46cc9698c6d4f4b79918174baf9c2339 (patch)
tree1229a35ca55d1b78ccb3634943ca308ae6e42c4d /src/gui/gui-chat.c
parenta06fa73ba82b9b7f69b5eb442087be39ea4dfd1e (diff)
downloadweechat-ae23fb0b46cc9698c6d4f4b79918174baf9c2339.zip
Fix bug with some utf-8 chars in input line
Diffstat (limited to 'src/gui/gui-chat.c')
-rw-r--r--src/gui/gui-chat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c
index ff45be3fa..31b452e8b 100644
--- a/src/gui/gui-chat.c
+++ b/src/gui/gui-chat.c
@@ -129,7 +129,7 @@ gui_chat_strlen_screen (const char *string)
string = gui_chat_string_next_char (NULL, (unsigned char *)string, 0);
if (string)
{
- size_on_screen = (string[0] < 32) ? 1 : utf8_char_size_screen (string);
+ size_on_screen = (((unsigned char)string[0]) < 32) ? 1 : utf8_char_size_screen (string);
if (size_on_screen > 0)
length += size_on_screen;
string = utf8_next_char (string);
@@ -183,7 +183,7 @@ gui_chat_string_real_pos (const char *string, int pos)
0);
if (ptr_string)
{
- size_on_screen = (ptr_string[0] < 32) ? 1 : utf8_char_size_screen (ptr_string);
+ size_on_screen = (((unsigned char)ptr_string[0]) < 32) ? 1 : utf8_char_size_screen (ptr_string);
if (size_on_screen > 0)
pos -= size_on_screen;
ptr_string = utf8_next_char (ptr_string);