# HG changeset patch # User Kim Alvefur # Date 1528027770 -7200 # Node ID c88f91626e078378f22461f017784700e1d26a40 # Parent a81456a137972c5a3f3c7023c5f0f9d29680ffee mod_pastebin: Off-by-one, the hardest problem known to man The threshold set to 4 allowed 4 lines and pastebinned 5. 040eaa3844f4 unintentionally changed this so that 4 lines were pastebinned. This commit restores the previous behavior. diff -r a81456a13797 -r c88f91626e07 mod_pastebin/mod_pastebin.lua --- a/mod_pastebin/mod_pastebin.lua Sun Jun 03 13:55:10 2018 +0200 +++ b/mod_pastebin/mod_pastebin.lua Sun Jun 03 14:09:30 2018 +0200 @@ -95,7 +95,7 @@ end end -local line_count_pattern = string.rep("[^\n]*\n", line_threshold):sub(1, -2); +local line_count_pattern = string.rep("[^\n]*\n", line_threshold + 1):sub(1,-2); function check_message(data) local stanza = data.stanza;