Skip to content

Commit

Permalink
cppCheck: Suspicious condition.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Christophe Jaillet committed Nov 10, 2012
1 parent 2363d7a commit 0b404c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/aaa/mod_authz_dbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 0b404c2

Please sign in to comment.