summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-curses-chat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/curses/gui-curses-chat.c')
-rw-r--r--src/gui/curses/gui-curses-chat.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index ce6bfb59f..9459c8e47 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -446,18 +446,21 @@ gui_chat_display_word_raw (struct t_gui_window *window, const char *string,
utf_char[next_char - string] = '\0';
if (gui_window_utf_char_valid (utf_char))
{
+ size_on_screen = utf8_strlen_screen (utf_char);
if (max_chars_on_screen > 0)
{
- size_on_screen = utf8_strlen_screen (utf_char);
if (chars_displayed + size_on_screen > max_chars_on_screen)
return;
chars_displayed += size_on_screen;
}
- output = string_iconv_from_internal (NULL, utf_char);
- wprintw (GUI_CURSES(window)->win_chat,
- "%s", (output) ? output : utf_char);
- if (output)
- free (output);
+ if (size_on_screen > 0)
+ {
+ output = string_iconv_from_internal (NULL, utf_char);
+ wprintw (GUI_CURSES(window)->win_chat,
+ "%s", (output) ? output : utf_char);
+ if (output)
+ free (output);
+ }
}
else
{