# HG changeset patch # User Paul Aurich # Date 1259627422 0 # Node ID f10741a709a98392f0d9492f4d802621a7daaaff # Parent 295d814b76ac048157b89adf0eb496f96619c6bd jabber: Should have looked for this function earlier. diff -r 295d814b76ac -r f10741a709a9 libpurple/protocols/jabber/auth_scram.c --- a/libpurple/protocols/jabber/auth_scram.c Mon Nov 30 20:35:41 2009 +0000 +++ b/libpurple/protocols/jabber/auth_scram.c Tue Dec 01 00:30:22 2009 +0000 @@ -363,21 +363,12 @@ static gchar *escape_username(const gchar *in) { - GString *s = g_string_new(in); - gchar *c; - gsize i = 0; + gchar *tmp, *tmp2; - c = s->str; - while (*c) { - if (*c == ',' || *c == '=') { - g_string_erase(s, i, 1); - g_string_insert(s, i, *c == ',' ? "=2C" : "=3D"); - } - - ++c; ++i; - } - - return g_string_free(s, FALSE); + tmp = purple_strreplace(in, "=", "=3D"); + tmp2 = purple_strreplace(tmp, ",", "=2D"); + g_free(tmp); + return tmp2; } static xmlnode *scram_start(JabberStream *js, xmlnode *mechanisms)