diff mbox

[1/7] libsepol: cil: silence clang analyzer false positive

Message ID 20180526184213.4896-2-nicolas.iooss@m4x.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Nicolas Iooss May 26, 2018, 6:42 p.m. UTC
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.iooss@m4x.org>
---
 libsepol/cil/src/cil_tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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;
 	}