]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
cppCheck: Suspicious condition.
authorChristophe Jaillet <jailletc36@apache.org>
Sat, 10 Nov 2012 17:21:42 +0000 (17:21 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sat, 10 Nov 2012 17:21:42 +0000 (17:21 +0000)
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

modules/aaa/mod_authz_dbd.c

index 86d3b5612a96f7615f570d02b442a00022c0b09a..2d4925f5224f708aa04c0419983079c09a0047e1 100644 (file)
@@ -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)) {