]> source.dussan.org Git - rspamd.git/commitdiff
Ignore arguments order in compare_parts_distance function.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 14 Jul 2011 06:24:15 +0000 (10:24 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 14 Jul 2011 06:24:15 +0000 (10:24 +0400)
src/expressions.c

index b231bb309bc57147b097102559de9beadf741147..2d564aa22a0474a1569eba96b26010cb53dadf6e 100644 (file)
@@ -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;
                                }
                        }