# HG changeset patch # User Sadrul Habib Chowdhury # Date 1154748014 0 # Node ID 942170284c559772bab591f7628f54f75aa8f31f # Parent 0e70bb6d32fd85da4e6acff57dd8715b44d2a15e [gaim-migrate @ 16633] Do not crash. committer: Tailor Script diff -r 0e70bb6d32fd -r 942170284c55 console/libgnt/gntentry.c --- a/console/libgnt/gntentry.c Sat Aug 05 02:56:18 2006 +0000 +++ b/console/libgnt/gntentry.c Sat Aug 05 03:20:14 2006 +0000 @@ -126,7 +126,7 @@ if (entry->max && g_utf8_pointer_to_offset(entry->start, entry->end) >= entry->max) continue; - if (g_utf8_pointer_to_offset(entry->start, entry->end) >= entry->buffer) + if (entry->end - entry->start >= entry->buffer) { char *tmp = g_strdup_printf(entry->start); gnt_entry_set_text(entry, tmp); @@ -255,15 +255,15 @@ if (text && text[0]) { - len = g_utf8_strlen(text, -1); - entry->buffer = len * 2; + len = strlen(text); } else { - entry->buffer = 128; len = 0; } + entry->buffer = len + 128; + scroll = entry->scroll - entry->start; cursor = entry->end - entry->cursor;