From 81d3a05c48d42073de4550341dd2efc36074105f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 14 Jul 2011 10:24:15 +0400 Subject: [PATCH] Ignore arguments order in compare_parts_distance function. --- src/expressions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/expressions.c b/src/expressions.c index b231bb309..2d564aa22 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -1093,8 +1093,8 @@ rspamd_parts_distance (struct worker_task * task, GList * args, void *unused) debug_task ("got likeliness between parts of %d%%, threshold is %d%%", diff, threshold); *pdiff = diff; memory_pool_set_variable (task->task_pool, "parts_distance", pdiff, NULL); - if (threshold2 > 0 && threshold < threshold2) { - if (diff >= threshold && diff <= threshold2) { + if (threshold2 > 0) { + if (diff >= MIN (threshold, threshold2) && diff <= MAX (threshold, threshold2)) { return TRUE; } } -- 2.39.5