From d4aaa93047005974b620310d450782c3906a0cfd Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Thu, 10 Jul 2014 15:00:05 -0700 Subject: [PATCH] GetLiveChar converted to StringFormat --- common/database.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 3292d0fd2..4d32b9ec3 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -1554,17 +1554,15 @@ bool Database::UpdateLiveChar(char* charname,uint32 lsaccount_id) { } bool Database::GetLiveChar(uint32 account_id, char* cname) { - char *query = nullptr; - auto results = QueryDatabase(query, MakeAnyLenString(&query, "SELECT charname FROM account WHERE id=%i", account_id)); + std::string query = StringFormat("SELECT charname FROM account WHERE id=%i", account_id); + auto results = QueryDatabase(query); if (!results.Success()) { std::cerr << "Error in GetLiveChar query '" << query << "' " << results.ErrorMessage() << std::endl; - safe_delete_array(query); return false; } - safe_delete_array(query); if (results.RowCount() != 1) return false;