aboutsummaryrefslogtreecommitdiffstats
path: root/src/expressions.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-14 10:24:15 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-14 10:24:15 +0400
commit81d3a05c48d42073de4550341dd2efc36074105f (patch)
tree31cd06252a146672b83195be1e590a98ff71e0cb /src/expressions.c
parent00e5f24b527fab74d6447733025ef5a18a814018 (diff)
downloadrspamd-81d3a05c48d42073de4550341dd2efc36074105f.tar.gz
rspamd-81d3a05c48d42073de4550341dd2efc36074105f.zip
Ignore arguments order in compare_parts_distance function.
Diffstat (limited to 'src/expressions.c')
-rw-r--r--src/expressions.c4
1 files 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;
}
}