# HG changeset patch # User Paul Aurich # Date 1259686017 0 # Node ID 4ab6f0479bc5f8da236f6694a7521bc6383bb228 # Parent 6ebacc1710b24890bb888b5b58eb479d3854b6e3 strchr() is safe when searching for an ASCII character in UTF8 strings. diff -r 6ebacc1710b2 -r 4ab6f0479bc5 libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Tue Dec 01 04:56:47 2009 +0000 +++ b/libpurple/protocols/jabber/buddy.c Tue Dec 01 16:46:57 2009 +0000 @@ -1860,8 +1860,10 @@ * However, since the gateway might appear offline to us, we cannot get that information. Therefore, I just assume * that gateways on the roster can be identified by having no '@' in their jid. This is a faily safe assumption, since * people don't tend to have a server or other service there. + * + * TODO: Use disco#info... */ - if (g_utf8_strchr(name, -1, '@') == NULL) { + if (strchr(name, '@') == NULL) { act = purple_menu_action_new(_("Log In"), PURPLE_CALLBACK(jabber_buddy_login), NULL, NULL); diff -r 6ebacc1710b2 -r 4ab6f0479bc5 libpurple/protocols/jabber/chat.c --- a/libpurple/protocols/jabber/chat.c Tue Dec 01 04:56:47 2009 +0000 +++ b/libpurple/protocols/jabber/chat.c Tue Dec 01 16:46:57 2009 +0000 @@ -927,7 +927,7 @@ jcm = g_hash_table_lookup(chat->members, who); if (jcm && jcm->jid) jid = jcm->jid; - else if (g_utf8_strchr(who, -1, '@') != NULL) + else if (strchr(who, '@') != NULL) jid = who; else return FALSE; @@ -964,7 +964,7 @@ jcm = g_hash_table_lookup(chat->members, who); if (jcm && jcm->jid) jid = jcm->jid; - else if (g_utf8_strchr(who, -1, '@') != NULL) + else if (strchr(who, '@') != NULL) jid = who; else return FALSE; diff -r 6ebacc1710b2 -r 4ab6f0479bc5 libpurple/protocols/jabber/presence.c --- a/libpurple/protocols/jabber/presence.c Tue Dec 01 04:56:47 2009 +0000 +++ b/libpurple/protocols/jabber/presence.c Tue Dec 01 16:46:57 2009 +0000 @@ -433,7 +433,7 @@ JabberPresenceCapabilities *userdata) { JabberBuddyResource *jbr; - char *resource = g_utf8_strchr(userdata->from, -1, '/'); + char *resource = strchr(userdata->from, '/'); if (resource) resource += 1;