From: Wilfried Goesgens Date: Tue, 24 May 2011 21:48:49 +0000 (+0000) Subject: fix the evaluation of password quality; thanks to the clang static analyzer for point... X-Git-Tag: v7.87~17^2~9 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=96d84ad577dfa8e5f570336c940fb442ec24ba35 fix the evaluation of password quality; thanks to the clang static analyzer for pointing me there. --- diff --git a/webcit/auth.c b/webcit/auth.c index d37382f22..fde5a501b 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -681,7 +681,7 @@ void validate(void) int haveChar = 0; int haveNum = 0; int haveOther = 0; - int count = 0; + int haveLong = 0; pch = buf; while (!IsEmptyStr(pch)) { @@ -693,10 +693,13 @@ void validate(void) haveOther = 1; pch ++; } - count = pch - buf; - if (count > 7) - count = 0; - switch (count){ + if (pch - buf > 7) + haveLong = 1; + switch (haveLong + + haveChar + + haveNum + + haveOther) + { case 0: pch = _("very weak"); break;