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/game/StarTechDatabase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/game/StarTechDatabase.cpp') diff --git a/source/game/StarTechDatabase.cpp b/source/game/StarTechDatabase.cpp index ae8defa..a1cce3e 100644 --- a/source/game/StarTechDatabase.cpp +++ b/source/game/StarTechDatabase.cpp @@ -19,7 +19,7 @@ TechDatabase::TechDatabase() { auto tech = parseTech(assets->json(file), file); if (m_tech.contains(tech.name)) - throw TechDatabaseException::format("Duplicate tech named '%s', config file '%s'", tech.name, file); + throw TechDatabaseException::format("Duplicate tech named '{}', config file '{}'", tech.name, file); m_tech[tech.name] = tech; } } @@ -31,7 +31,7 @@ bool TechDatabase::contains(String const& techName) const { TechConfig TechDatabase::tech(String const& techName) const { if (auto p = m_tech.ptr(techName)) return *p; - throw TechDatabaseException::format("No such tech '%s'", techName); + throw TechDatabaseException::format("No such tech '{}'", techName); } TechConfig TechDatabase::parseTech(Json const& config, String const& path) const { @@ -55,7 +55,7 @@ TechConfig TechDatabase::parseTech(Json const& config, String const& path) const return tech; } catch (std::exception const& e) { - throw TechDatabaseException(strf("Error reading tech config %s", path), e); + throw TechDatabaseException(strf("Error reading tech config {}", path), e); } } -- cgit v1.2.3