diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-04-12 10:16:49 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-04-12 10:16:49 +0900 |
commit | d527fda6216780281b90f48820ae978c61c7905c (patch) | |
tree | 3563030ccc2a229701963fa6f13e6e12e5a1b78e /src/test/modules/test_rls_hooks/test_rls_hooks.c | |
parent | 798070ec058fe75757587c9e9916cc35c623f427 (diff) | |
download | postgresql-d527fda6216780281b90f48820ae978c61c7905c.tar.gz postgresql-d527fda6216780281b90f48820ae978c61c7905c.zip |
Fix more strcmp() calls using boolean-like comparisons for result checks
Such calls can confuse the reader as strcmp() uses an integer as result.
The places patched here have been spotted by Thomas Munro, David Rowley
and myself.
Author: Michael Paquier
Reviewed-by: David Rowley
Discussion: https://postgr.es/m/20190411021946.GG2728@paquier.xyz
Diffstat (limited to 'src/test/modules/test_rls_hooks/test_rls_hooks.c')
-rw-r--r-- | src/test/modules/test_rls_hooks/test_rls_hooks.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/modules/test_rls_hooks/test_rls_hooks.c b/src/test/modules/test_rls_hooks/test_rls_hooks.c index 8bf8f764ac3..10379bc59c0 100644 --- a/src/test/modules/test_rls_hooks/test_rls_hooks.c +++ b/src/test/modules/test_rls_hooks/test_rls_hooks.c @@ -75,8 +75,8 @@ test_rls_hooks_permissive(CmdType cmdtype, Relation relation) ParseState *qual_pstate; RangeTblEntry *rte; - if (strcmp(RelationGetRelationName(relation), "rls_test_permissive") - && strcmp(RelationGetRelationName(relation), "rls_test_both")) + if (strcmp(RelationGetRelationName(relation), "rls_test_permissive") != 0 && + strcmp(RelationGetRelationName(relation), "rls_test_both") != 0) return NIL; qual_pstate = make_parsestate(NULL); @@ -140,8 +140,8 @@ test_rls_hooks_restrictive(CmdType cmdtype, Relation relation) RangeTblEntry *rte; - if (strcmp(RelationGetRelationName(relation), "rls_test_restrictive") - && strcmp(RelationGetRelationName(relation), "rls_test_both")) + if (strcmp(RelationGetRelationName(relation), "rls_test_restrictive") != 0 && + strcmp(RelationGetRelationName(relation), "rls_test_both") != 0) return NIL; qual_pstate = make_parsestate(NULL); |