aboutsummaryrefslogtreecommitdiffstats
path: root/util/human
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-12 14:22:21 +0100
committerKim Alvefur <zash@zash.se>2021-11-12 14:22:21 +0100
commitd6b3625be21223fd05d103fc132f753747965c6d (patch)
treea60b3e729ecea85e33b5a6b12a0222eefb66f87b /util/human
parentd1144a7ede35eb04e0c81c328e3684eb1f7f3f72 (diff)
downloadprosody-d6b3625be21223fd05d103fc132f753747965c6d.tar.gz
prosody-d6b3625be21223fd05d103fc132f753747965c6d.zip
util.human.io: Use UTF-8-aware length check in padding functions
Diffstat (limited to 'util/human')
-rw-r--r--util/human/io.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/human/io.lua b/util/human/io.lua
index 83a521c3..7d7dea97 100644
--- a/util/human/io.lua
+++ b/util/human/io.lua
@@ -93,11 +93,11 @@ local function printf(fmt, ...)
end
local function padright(s, width)
- return s..string.rep(" ", width-#s);
+ return s..string.rep(" ", width-len(s));
end
local function padleft(s, width)
- return string.rep(" ", width-#s)..s;
+ return string.rep(" ", width-len(s))..s;
end
local pat = "[%z\001-\127\194-\253][\128-\191]*";