GetAccountIDByName converted to StringFormat

This commit is contained in:
Arthur Ice 2014-07-08 19:57:37 -07:00 committed by Arthur Ice
parent a64ef36d06
commit 2f8cc6e57b

View File

@ -704,12 +704,11 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) {
}
uint32 Database::GetAccountIDByName(const char* accname, int16* status, uint32* lsid) {
char *query = nullptr;
if (!isAlphaNumeric(accname))
return 0;
auto results = QueryDatabase(query, MakeAnyLenString(&query, "SELECT id, status, lsaccount_id FROM account WHERE name='%s'", accname));
std::string query = StringFormat("SELECT id, status, lsaccount_id FROM account WHERE name='%s'", accname);
auto results = QueryDatabase(query);
if (!results.Success())
{