From 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:23:44 +1000 Subject: The Formatting String Catastrophe --- source/core/StarJsonExtra.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/core/StarJsonExtra.cpp') diff --git a/source/core/StarJsonExtra.cpp b/source/core/StarJsonExtra.cpp index d683ca1..ec6fe90 100644 --- a/source/core/StarJsonExtra.cpp +++ b/source/core/StarJsonExtra.cpp @@ -147,7 +147,7 @@ RectD jsonToRectD(Json const& v) { auto upperRight = jsonToVec2D(v.get(1)); return RectD(lowerLeft, upperRight); } catch (JsonException const& e) { - throw JsonException(strf("Inner position not well formed in jsonToRectD: %s", outputException(e, true))); + throw JsonException(strf("Inner position not well formed in jsonToRectD: {}", outputException(e, true))); } } @@ -178,7 +178,7 @@ RectI jsonToRectI(Json const& v) { auto upperRight = jsonToVec2I(v.get(1)); return RectI(lowerLeft, upperRight); } catch (JsonException const& e) { - throw JsonException(strf("Inner position not well formed in jsonToRectI: %s", outputException(e, true))); + throw JsonException(strf("Inner position not well formed in jsonToRectI: {}", outputException(e, true))); } } @@ -201,7 +201,7 @@ RectU jsonToRectU(Json const& v) { auto upperRight = jsonToVec2U(v.get(1)); return RectU(lowerLeft, upperRight); } catch (JsonException const& e) { - throw JsonException(strf("Inner position not well formed in jsonToRectU: %s", outputException(e, true))); + throw JsonException(strf("Inner position not well formed in jsonToRectU: {}", outputException(e, true))); } } @@ -226,7 +226,7 @@ Color jsonToColor(Json const& v) { } else if (v.type() == Json::Type::String) { return Color(v.toString()); } else { - throw JsonException(strf("Json of type %s cannot be converted to color", v.typeName())); + throw JsonException(strf("Json of type {} cannot be converted to color", v.typeName())); } } -- cgit v1.2.3