# HG changeset patch # User Paul Aurich # Date 1257499840 0 # Node ID 18b64ff28354d49e4a0c2353a0b33bac0187f25c # Parent 46fd79aa46c5326f14ac44b2931ace98ca983d5c jabber: These uses of strlen() are unnecessary. diff -r 46fd79aa46c5 -r 18b64ff28354 libpurple/protocols/jabber/auth.c --- a/libpurple/protocols/jabber/auth.c Fri Nov 06 09:16:01 2009 +0000 +++ b/libpurple/protocols/jabber/auth.c Fri Nov 06 09:30:40 2009 +0000 @@ -381,13 +381,13 @@ * due to mechanism specific issues, so we want to try one of the other * supported mechanisms. This code handles that case */ - if (js->current_mech && strlen(js->current_mech) > 0) { + if (js->current_mech && *js->current_mech) { char *pos; if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) { g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(js->current_mech)); } /* Remove space which separated this mech from the next */ - if (strlen(js->sasl_mechs->str) > 0 && ((js->sasl_mechs->str)[0] == ' ')) { + if ((js->sasl_mechs->str)[0] == ' ') { g_string_erase(js->sasl_mechs, 0, 1); } again = TRUE; @@ -1099,17 +1099,17 @@ #ifdef HAVE_CYRUS_SASL if(js->auth_fail_count++ < 5) { - if (js->current_mech && strlen(js->current_mech) > 0) { + if (js->current_mech && *js->current_mech) { char *pos; if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) { g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(js->current_mech)); } /* Remove space which separated this mech from the next */ - if (strlen(js->sasl_mechs->str) > 0 && ((js->sasl_mechs->str)[0] == ' ')) { + if ((js->sasl_mechs->str)[0] == ' ') { g_string_erase(js->sasl_mechs, 0, 1); } } - if (strlen(js->sasl_mechs->str)) { + if (*js->sasl_mechs->str) { /* If we have remaining mechs to try, do so */ sasl_dispose(&js->sasl);