]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Forgot fabs
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Jul 2021 14:38:49 +0000 (15:38 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Jul 2021 14:38:49 +0000 (15:38 +0100)
src/libutil/expression.c

index 553767c3a00e0eef72305d955e02ab90e1ea6540..7dddfa72f9c4996874c0e3933d4ac2dddb4e87d7 100644 (file)
@@ -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: