From 8e8a21349fcf2de22f569bced750326d46da543b Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Thu, 10 Jul 2014 17:05:47 -0700 Subject: [PATCH] ClearGroupLeader converted to StringFormat --- common/database.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 26bc170f8..1ee5ea2a0 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -1791,16 +1791,15 @@ void Database::ClearAllGroupLeaders(void) } void Database::ClearGroupLeader(uint32 gid) { - char *query = nullptr; - + if(gid == 0) { ClearAllGroupLeaders(); return; } - auto results = QueryDatabase(query, MakeAnyLenString(&query, "DELETE from group_leaders where gid = %lu", (unsigned long)gid)); - safe_delete_array(query); + std::string query = StringFormat("DELETE from group_leaders where gid = %lu", (unsigned long)gid); + auto results = QueryDatabase(query); if (!results.Success()) std::cout << "Unable to clear group leader: " << results.ErrorMessage() << std::endl;