summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaJson.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-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);