# HG changeset patch # User Richard Laager # Date 1137032377 0 # Node ID 5f15d53b610a70c8769f76968dabae308abc8f38 # Parent ab37a4cc477edd5c0c3276386d54af8b31446f38 [gaim-migrate @ 15190] Turns out g_unichar_to_utf8 doesn't do NUL-termination for us. committer: Tailor Script diff -r ab37a4cc477e -r 5f15d53b610a plugins/spellchk.c --- a/plugins/spellchk.c Thu Jan 12 01:54:59 2006 +0000 +++ b/plugins/spellchk.c Thu Jan 12 02:19:37 2006 +0000 @@ -125,9 +125,12 @@ { char buf[7]; gchar *lower = g_utf8_strdown(word, -1); + gint bytes; gchar *ret; - g_unichar_to_utf8(g_unichar_toupper(g_utf8_get_char(word)), buf); + bytes = g_unichar_to_utf8(g_unichar_toupper(g_utf8_get_char(word)), buf); + buf[MIN(bytes, sizeof(buf) - 1)] = '\0'; + ret = g_strconcat(buf, g_utf8_offset_to_pointer(lower, 1), NULL); g_free(lower);