[gaim-migrate @ 14017]

Sat, 22 Oct 2005 22:58:16 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Sat, 22 Oct 2005 22:58:16 +0000
changeset 11726
6f319ff4cea5
parent 11725
0649170ebdf6
child 11727
ef78f9d0efec

[gaim-migrate @ 14017]
g_utf8_validate() and g_convert() accept -1 as a length argument, so there's no need to call strlen() ourselves.

src/protocols/irc/parse.c file | annotate | diff | comparison | revisions
--- a/src/protocols/irc/parse.c	Sat Oct 22 22:38:00 2005 +0000
+++ b/src/protocols/irc/parse.c	Sat Oct 22 22:58:16 2005 +0000
@@ -251,10 +251,10 @@
 			charset++;
 
 		if (!strcasecmp("UTF-8", charset)) {
-			if (g_utf8_validate(string, strlen(string), NULL))
+			if (g_utf8_validate(string, -1, NULL))
 				utf8 = g_strdup(string);
 		} else {
-			utf8 = g_convert(string, strlen(string), "UTF-8", charset, NULL, NULL, NULL);
+			utf8 = g_convert(string, -1, "UTF-8", charset, NULL, NULL, NULL);
 		}
 
 		if (utf8) {

mercurial