pidgin: a3e3cb37: strchr() is valid on a UTF8 string when ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Tue Dec 1 16:20:46 EST 2009


-----------------------------------------------------------------
Revision: a3e3cb37bb04fec56b54fa77acd443e05e17d0a6
Ancestor: 620db212c4a7d3e8ab6d192ef0c3ae5abfd764a0
Author: darkrain42 at pidgin.im
Date: 2009-12-01T16:49:15
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a3e3cb37bb04fec56b54fa77acd443e05e17d0a6

Modified files:
        libpurple/protocols/jabber/jingle/session.c
        pidgin/plugins/disco/gtkdisco.c

ChangeLog: 

strchr() is valid on a UTF8 string when searching for an ASCII character

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/session.c	8375c7a66d153b47e5e87144b6b623c0f4dfdd9b
+++ libpurple/protocols/jabber/jingle/session.c	0a9a62d441817feb4e634b6022ee2c36cc3d547d
@@ -377,7 +377,7 @@ static gboolean find_by_jid_ghr(gpointer
 {
 	JingleSession *session = (JingleSession *)value;
 	const gchar *jid = user_data;
-	gboolean use_bare = g_utf8_strchr(jid, -1, '/') == NULL;
+	gboolean use_bare = strchr(jid, '/') == NULL;
 	gchar *remote_jid = jingle_session_get_remote_jid(session);
 	gchar *cmp_jid = use_bare ? jabber_get_bare_jid(remote_jid)
 				  : g_strdup(remote_jid);
@@ -438,7 +438,7 @@ jingle_session_find_by_jid(JabberStream 
 
 	data.jid = jid;
 	data.ret = NULL;
-	data.use_bare = g_utf8_strchr(jid, -1, '/') == NULL;
+	data.use_bare = strchr(jid, '/') == NULL;
 
 	g_hash_table_foreach(js->sessions, find_by_jid_ghr, &data);
 	return data.ret;
============================================================
--- pidgin/plugins/disco/gtkdisco.c	0ceb6d42f2e485937e9deae6cf35014d3b7ddf45
+++ pidgin/plugins/disco/gtkdisco.c	ed8c3bf137e307e99f4803718ed358f527314bc8
@@ -225,8 +225,8 @@ static void browse_button_cb(GtkWidget *
 		gtk_widget_set_sensitive(dialog->account_widget, FALSE);
 
 	username = purple_account_get_username(dialog->account);
-	at = g_utf8_strchr(username, -1, '@');
-	slash = g_utf8_strchr(username, -1, '/');
+	at = strchr(username, -1, '@');
+	slash = strchr(username, -1, '/');
 	if (at && !slash) {
 		server = g_strdup_printf("%s", at + 1);
 	} else if (at && slash && at + 1 < slash) {


More information about the Commits mailing list