summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaJson.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2023-05-11 22:05:17 +0200
committerMattes D <github@xoft.cz>2023-05-16 23:50:37 +0200
commitc9522fb740200ccef6230cec452c48efb31e5394 (patch)
tree7e74d70699e13dd0a92444a1a0add7a3059ac7ca /src/Bindings/LuaJson.cpp
parentTry a timeout for jobs. (diff)
downloadcuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.gz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.bz2
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.lz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.xz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.zst
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.zip
Diffstat (limited to 'src/Bindings/LuaJson.cpp')
-rw-r--r--src/Bindings/LuaJson.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Bindings/LuaJson.cpp b/src/Bindings/LuaJson.cpp
index 1cd88cf96..1077b6e56 100644
--- a/src/Bindings/LuaJson.cpp
+++ b/src/Bindings/LuaJson.cpp
@@ -42,7 +42,7 @@ public:
/** Constructs a new instance of the exception based on the provided values directly. */
explicit CannotSerializeException(int a_ValueIndex, const char * a_ErrorMsg):
Super(a_ErrorMsg),
- m_ValueName(Printf("%d", a_ValueIndex))
+ m_ValueName(fmt::format(FMT_STRING("{}"), a_ValueIndex))
{
}
@@ -58,7 +58,7 @@ public:
Used for prefixing the value name's path along the call stack that lead to the main exception. */
explicit CannotSerializeException(const CannotSerializeException & a_Parent, int a_ValueNamePrefixIndex):
Super(a_Parent.what()),
- m_ValueName(Printf("%d", a_ValueNamePrefixIndex) + "." + a_Parent.m_ValueName)
+ m_ValueName(fmt::format(FMT_STRING("{}"), a_ValueNamePrefixIndex) + "." + a_Parent.m_ValueName)
{
}
@@ -299,7 +299,7 @@ static int tolua_cJson_Parse(lua_State * a_LuaState)
AString ParseError;
if (!JsonUtils::ParseString(input, root, &ParseError))
{
- L.Push(cLuaState::Nil, Printf("Parsing Json failed: %s", ParseError));
+ L.Push(cLuaState::Nil, fmt::format(FMT_STRING("Parsing Json failed: {}"), ParseError));
return 2;
}
@@ -338,7 +338,10 @@ static int tolua_cJson_Serialize(lua_State * a_LuaState)
catch (const CannotSerializeException & exc)
{
lua_pushnil(L);
- L.Push(Printf("Cannot serialize into Json, value \"%s\" caused an error \"%s\"", exc.GetValueName().c_str(), exc.what()));
+ L.Push(fmt::format(
+ FMT_STRING("Cannot serialize into Json, value \"{}\" caused an error \"{}\""),
+ exc.GetValueName(), exc.what()
+ ));
return 2;
}
lua_pop(L, 1);