commit 9865ad6: [Minor] Forgot fabs

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jul 16 14:42:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-07-16 15:38:49 +0100
URL: https://github.com/rspamd/rspamd/commit/9865ad6ea49693e32ca8be832e0220d47bbf0127 (HEAD -> master)

[Minor] Forgot fabs

---
 src/libutil/expression.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libutil/expression.c b/src/libutil/expression.c
index 553767c3a..7dddfa72f 100644
--- a/src/libutil/expression.c
+++ b/src/libutil/expression.c
@@ -1305,10 +1305,10 @@ rspamd_ast_do_nary_op (struct rspamd_expression_elt *elt, gdouble val, gdouble a
 		ret = acc * val;
 		break;
 	case OP_AND:
-		ret = (acc > DBL_EPSILON) && (val > DBL_EPSILON);
+		ret = (fabs(acc) > DBL_EPSILON) && (fabs(val) > DBL_EPSILON);
 		break;
 	case OP_OR:
-		ret = (acc > DBL_EPSILON) || (val > DBL_EPSILON);
+		ret = (fabs(acc) > DBL_EPSILON) || (fabs(val) > DBL_EPSILON);
 		break;
 	default:
 	case OP_NOT:


More information about the Commits mailing list