This patch adds parenthesis around an expression to avoid confusion
between order preference of && and || operators.
Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
struct pgsql_instance *pi = (struct pgsql_instance *) upi->private;
pi->pgres = PQexec(pi->dbh, stmt);
- if (!(pi->pgres && (PQresultStatus(pi->pgres) == PGRES_COMMAND_OK)
- || (PQresultStatus(pi->pgres) == PGRES_TUPLES_OK))) {
+ if (!(pi->pgres && ((PQresultStatus(pi->pgres) == PGRES_COMMAND_OK)
+ || (PQresultStatus(pi->pgres) == PGRES_TUPLES_OK)))) {
ulogd_log(ULOGD_ERROR, "execute failed (%s)\n",
PQerrorMessage(pi->dbh));
return -1;