From: Eric Leblond Date: Thu, 31 Jul 2008 08:44:15 +0000 (+0200) Subject: cleanup: fix compilation warning about lack of parenthesis X-Git-Tag: ulogd-2.0.0beta2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61704a1f28aad1c64cbcdbec67be17e675482065;p=thirdparty%2Fulogd2.git cleanup: fix compilation warning about lack of parenthesis This patch adds parenthesis around an expression to avoid confusion between order preference of && and || operators. Signed-off-by: Eric Leblond Signed-off-by: Pablo Neira Ayuso --- diff --git a/output/pgsql/ulogd_output_PGSQL.c b/output/pgsql/ulogd_output_PGSQL.c index b04526a..afab2cc 100644 --- a/output/pgsql/ulogd_output_PGSQL.c +++ b/output/pgsql/ulogd_output_PGSQL.c @@ -288,8 +288,8 @@ static int execute_pgsql(struct ulogd_pluginstance *upi, 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;