From d3fecd94e4bec42109fa400accbf8f91f3d57fe0 Mon Sep 17 00:00:00 2001 From: Peter Nerlich Date: Mon, 7 Dec 2020 14:17:39 +0100 Subject: [PATCH] better readable condition Co-authored-by: Christopher Head --- lcd.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lcd.lua b/lcd.lua index ca698c6..9862937 100644 --- a/lcd.lua +++ b/lcd.lua @@ -96,7 +96,7 @@ local create_lines = function(text) line = line .. " " remaining = remaining - 1 end - if remaining - string.len(word) < 0 then + if remaining < string.len(word) then line = line .. string.sub(word, 1, math.min(remaining, string.len(word))) word = string.sub(word, remaining+1, string.len(word)) if flush_line_and_check_for_return() then return tab end