# HG changeset patch # User Sadrul Habib Chowdhury # Date 1160623987 0 # Node ID 1d084d1ee6fabbff87b0a9eb1220f8edf1b0cf10 # Parent 07f572e087736390c26a579fc62a63e22c22c728 [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 diff -r 07f572e08773 -r 1d084d1ee6fa console/libgnt/gntutils.c --- 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)