From: Vsevolod Stakhov Date: Thu, 14 Jul 2011 06:24:15 +0000 (+0400) Subject: Ignore arguments order in compare_parts_distance function. X-Git-Tag: 0.4.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81d3a05c48d42073de4550341dd2efc36074105f;p=thirdparty%2Frspamd.git Ignore arguments order in compare_parts_distance function. --- diff --git a/src/expressions.c b/src/expressions.c index b231bb309b..2d564aa22a 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; } }