diff -r ce9f0fe6a77a -r a5938aa3f6c9 console/libgnt/gnttextview.c --- a/console/libgnt/gnttextview.c Sun Jan 14 20:38:18 2007 +0000 +++ b/console/libgnt/gnttextview.c Mon Jan 15 01:10:55 2007 +0000 @@ -509,6 +509,7 @@ { GList *alllines = g_list_first(view->list); GList *list, *next, *iter, *inext; + const int text_length = text ? g_utf8_strlen(text, -1) : 0; int count = 0; for (list = view->tags; list; list = next) { GntTextTag *tag = list->data; @@ -521,7 +522,7 @@ before = g_strndup(view->string->str, tag->start); after = g_strdup(view->string->str + tag->end); - change = (tag->end - tag->start) - (text ? strlen(text) : 0); + change = (tag->end - tag->start) - text_length; g_string_printf(view->string, "%s%s%s", before, text ? text : "", after); g_free(before);