commit 14be232: [Minor] Another PUC-Rio Lua compatibility fix

Andrew Lewis nerf at judo.za.org
Mon Sep 6 10:14:04 UTC 2021


Author: Andrew Lewis
Date: 2021-09-06 11:17:28 +0200
URL: https://github.com/rspamd/rspamd/commit/14be23205a19ae111447aee2b2b10264a7278f74 (refs/pull/3880/head)

[Minor] Another PUC-Rio Lua compatibility fix
 - Reported by @mebourne

---
 src/plugins/lua/milter_headers.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua
index 1b58cee86..6704ba3f2 100644
--- a/src/plugins/lua/milter_headers.lua
+++ b/src/plugins/lua/milter_headers.lua
@@ -356,9 +356,9 @@ local function milter_headers(task)
     local score = common['metric_score'][1]
     local spambar
     if score <= -1 then
-      spambar = string.rep(local_mod.negative, score * (-1))
+      spambar = string.rep(local_mod.negative, math.floor(score * -1))
     elseif score >= 1 then
-      spambar = string.rep(local_mod.positive, score)
+      spambar = string.rep(local_mod.positive, math.floor(score))
     else
       spambar = local_mod.neutral
     end


More information about the Commits mailing list