]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Another PUC-Rio Lua compatibility fix 3880/head
authorAndrew Lewis <nerf@judo.za.org>
Mon, 6 Sep 2021 09:17:28 +0000 (11:17 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 6 Sep 2021 09:17:28 +0000 (11:17 +0200)
 - Reported by @mebourne

src/plugins/lua/milter_headers.lua

index 1b58cee860610b150ec13d3bd4ebc07accb6b5c7..6704ba3f23a714abe22d056eea980ee944c0d7f6 100644 (file)
@@ -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