From c9522fb740200ccef6230cec452c48efb31e5394 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 11 May 2023 22:05:17 +0200 Subject: Removed all Printf-family functions from StringUtils. Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code. --- src/RankManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/RankManager.cpp') diff --git a/src/RankManager.cpp b/src/RankManager.cpp index 9e6100ffe..7652fbcf4 100644 --- a/src/RankManager.cpp +++ b/src/RankManager.cpp @@ -1896,7 +1896,7 @@ bool cRankManager::DoesColumnExist(const char * a_TableName, const char * a_Colu { try { - SQLite::Statement stmt(m_DB, Printf("PRAGMA table_info(%s)", a_TableName)); + SQLite::Statement stmt(m_DB, fmt::format(FMT_STRING("PRAGMA table_info({})"), a_TableName)); while (stmt.executeStep()) // Iterate over all table's columns { int NumColumns = stmt.getColumnCount(); @@ -1936,7 +1936,7 @@ void cRankManager::CreateColumnIfNotExists(const char * a_TableName, const char // Add the column: try { - m_DB.exec(Printf("ALTER TABLE %s ADD COLUMN %s %s", a_TableName, a_ColumnName, a_ColumnType)); + m_DB.exec(fmt::format(FMT_STRING("ALTER TABLE {} ADD COLUMN {} {}"), a_TableName, a_ColumnName, a_ColumnType)); } catch (const SQLite::Exception & exc) { -- cgit v1.2.3