From c77b88cd380c0a6276f90ff0d9963a2e710560bf Mon Sep 17 00:00:00 2001 From: Kindi Date: Thu, 7 Sep 2023 21:42:21 +0800 Subject: [PATCH] fix string format --- components/lua/utf8.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lua/utf8.cpp b/components/lua/utf8.cpp index 45e05b45d3..b486766b6a 100644 --- a/components/lua/utf8.cpp +++ b/components/lua/utf8.cpp @@ -23,7 +23,7 @@ namespace if (std::modf(arg, &integer) != 0) throw std::runtime_error( - Misc::StringUtils::format("bad argument #{} to '{}' (number has no integer representation)", n, name)); + Misc::StringUtils::format("bad argument #%i to '%s' (number has no integer representation)", n, name)); return integer; } @@ -102,7 +102,7 @@ namespace LuaUtf8 int64_t codepoint = getInteger(args[i], (i + 1), "char"); if (codepoint < 0 || codepoint > MAXUTF) throw std::runtime_error( - Misc::StringUtils::format("bad argument #{} to 'char' (value out of range)", (i + 1))); + "bad argument #" + std::to_string(i + 1) + " to 'char' (value out of range)"); result += converter.to_bytes(codepoint); }