From: Richard L. <rl...@us...> - 2006-01-12 02:19:45
|
Update of /cvsroot/gaim/gaim/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17143 Modified Files: spellchk.c Log Message: Turns out g_unichar_to_utf8 doesn't do NUL-termination for us. Index: spellchk.c =================================================================== RCS file: /cvsroot/gaim/gaim/plugins/spellchk.c,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -p -r1.101 -r1.102 --- spellchk.c 4 Jan 2006 03:01:32 -0000 1.101 +++ spellchk.c 12 Jan 2006 02:19:37 -0000 1.102 @@ -125,9 +125,12 @@ make_word_proper(const gchar *word) { 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); |