From: Wilfried Goesgens Date: Sat, 26 May 2012 13:26:55 +0000 (+0200) Subject: remove duplicate assignments; don't compare twice if first is successfull. X-Git-Tag: v8.12~53 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=1c4cf61f583b0bd5d76923631112af1e00da49c1 remove duplicate assignments; don't compare twice if first is successfull. --- diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 2ca3b4220..c29a5613b 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -945,7 +945,6 @@ int CtdlTryPassword(const char *password, long len) CONM_syslog(LOG_INFO, "CtdlTryPassword: NULL password string supplied\n"); return pass_wrong_password; } - code = (-1); if (CCC->is_master) { code = strcmp(password, config.c_master_pass); @@ -1004,9 +1003,11 @@ int CtdlTryPassword(const char *password, long len) strproc(pw); strproc(CCC->user.password); code = strcasecmp(CCC->user.password, pw); - strproc(pw); - strproc(CCC->user.password); - code = strcasecmp(CCC->user.password, pw); + if (code != 0) { + strproc(pw); + strproc(CCC->user.password); + code = strcasecmp(CCC->user.password, pw); + } free (pw); }