In cil_tree_print_expr(), "rc < 0" is equivalent to "rc != 0" but
clang's static analyzer does not know about this. Help it.

Signed-off-by: Nicolas Iooss <nicolas.io...@m4x.org>
---
 libsepol/cil/src/cil_tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libsepol/cil/src/cil_tree.c b/libsepol/cil/src/cil_tree.c
index 1b04fe68a302..b1cbda918565 100644
--- a/libsepol/cil/src/cil_tree.c
+++ b/libsepol/cil/src/cil_tree.c
@@ -512,7 +512,7 @@ void cil_tree_print_expr(struct cil_list *datum_expr, 
struct cil_list *str_expr)
        } else {
                rc = cil_expr_to_string(str_expr, &expr_str);
        }
-       if (rc < 0) {
+       if (rc != SEPOL_OK) {
                cil_log(CIL_INFO, "ERROR)");
                return;
        }
-- 
2.17.0


_______________________________________________
Selinux mailing list
Selinux@tycho.nsa.gov
To unsubscribe, send email to selinux-le...@tycho.nsa.gov.
To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Reply via email to