changeset 29112:3d471a4bafac

strchr() is valid on a UTF8 string when searching for an ASCII character
author Paul Aurich <paul@darkrain42.org>
date Tue, 01 Dec 2009 16:49:15 +0000
parents 4ab6f0479bc5
children 3bf5dbff753b
files libpurple/protocols/jabber/jingle/session.c pidgin/plugins/disco/gtkdisco.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle/session.c	Tue Dec 01 16:46:57 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/session.c	Tue Dec 01 16:49:15 2009 +0000
@@ -377,7 +377,7 @@
 {
 	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 @@
 
 	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;
--- a/pidgin/plugins/disco/gtkdisco.c	Tue Dec 01 16:46:57 2009 +0000
+++ b/pidgin/plugins/disco/gtkdisco.c	Tue Dec 01 16:49:15 2009 +0000
@@ -225,8 +225,8 @@
 		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) {