From 130f74381c9b07ae51dc8e0657909b11fadf6ec0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 3 Jul 2021 04:35:29 +0200 Subject: util.format: Escape ASCII control characters also in extra arguments --- util/format.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/format.lua b/util/format.lua index 2a29c4f3..43097e6a 100644 --- a/util/format.lua +++ b/util/format.lua @@ -79,7 +79,7 @@ local function format(formatstring, ...) if arg == nil then args[i] = "(nil)"; else - args[i] = tostring(arg); + args[i] = tostring(arg):gsub("[%z\1-\8\11-\31\127]", control_symbols):gsub("\n\t?", "\n\t"); end formatstring = formatstring .. " [%s]" end -- cgit v1.2.3