summaryrefslogtreecommitdiff
path: root/libpurple/protocols/jabber/auth.c
diff options
context:
space:
mode:
authorPaul Aurich <darkrain42@pidgin.im>2009-11-06 09:30:40 +0000
committerPaul Aurich <darkrain42@pidgin.im>2009-11-06 09:30:40 +0000
commitdbe62aab89975410a387ee543b2c4cb357da686e (patch)
tree37f928b1612d2240bf43ffc14b0e0862af9204fb /libpurple/protocols/jabber/auth.c
parentd434c155638c8ed02ab0119f4d0bed34bcbdc481 (diff)
downloadpidgin-dbe62aab89975410a387ee543b2c4cb357da686e.tar.gz
jabber: These uses of strlen() are unnecessary.
Diffstat (limited to 'libpurple/protocols/jabber/auth.c')
-rw-r--r--libpurple/protocols/jabber/auth.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libpurple/protocols/jabber/auth.c b/libpurple/protocols/jabber/auth.c
index 9f3035c450..6903270149 100644
--- a/libpurple/protocols/jabber/auth.c
+++ b/libpurple/protocols/jabber/auth.c
@@ -381,13 +381,13 @@ static void jabber_auth_start_cyrus(JabberStream *js)
* 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 @@ void jabber_auth_handle_failure(JabberStream *js, xmlnode *packet)
#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);