Mercurial > pidgin
diff console/libgnt/gntutils.c @ 14714:1d084d1ee6fa
[gaim-migrate @ 17468]
Make sure things don't go crazy when you add text to a textview which is yet to
be given a size.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Thu, 12 Oct 2006 03:33:07 +0000 |
parents | ca36763497d9 |
children | 8a0cfee11af8 |
line wrap: on
line diff
--- a/console/libgnt/gntutils.c Thu Oct 12 03:30:25 2006 +0000 +++ b/console/libgnt/gntutils.c Thu Oct 12 03:33:07 2006 +0000 @@ -59,6 +59,10 @@ int width = 0; const char *str = string; + if (len <= 0) { + len = g_utf8_strlen(string, -1); + } + while (width < len && *str) { size = g_unichar_iswide(g_utf8_get_char(str)) ? 2 : 1; if (width + size > len)