From: Christophe Jaillet Date: Sat, 10 Nov 2012 17:21:42 +0000 (+0000) Subject: cppCheck: Suspicious condition. X-Git-Tag: 2.5.0-alpha~6130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eb44f881890fc5b38108f808b0ce0f72e22e9bf;p=thirdparty%2Fapache%2Fhttpd.git cppCheck: Suspicious condition. AFAIK, there is no actual problem with the existing code. 'rv' would only not have the 'expected' value, but the execution path would remain the same. However, the patched code is more logical. We put the returned value in 'rv', then test it against 0. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1407853 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_authz_dbd.c b/modules/aaa/mod_authz_dbd.c index 86d3b5612a9..2d4925f5224 100644 --- a/modules/aaa/mod_authz_dbd.c +++ b/modules/aaa/mod_authz_dbd.c @@ -163,7 +163,7 @@ static int authz_dbd_login(request_rec *r, authz_dbd_cfg *cfg, /* OK, this is non-critical; we can just not-redirect */ } else if ((rv = apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle, - &res, query, 0, r->user, NULL) == 0)) { + &res, query, 0, r->user, NULL)) == 0) { for (rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1); rv != -1; rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1)) {