Core: Append single character to stream as character, not as a string
This commit is contained in:
@@ -79,7 +79,6 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table
|
||||
std::ostringstream ss;
|
||||
do
|
||||
{
|
||||
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
uint32 id = fields[0].GetUInt32();
|
||||
@@ -92,7 +91,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table
|
||||
found = true;
|
||||
}
|
||||
else
|
||||
ss << ", ";
|
||||
ss << ',';
|
||||
|
||||
ss << id;
|
||||
}
|
||||
@@ -101,7 +100,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table
|
||||
|
||||
if (found)
|
||||
{
|
||||
ss << ")";
|
||||
ss << ')';
|
||||
CharacterDatabase.Execute(ss.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ bool findnth(std::string &str, int n, std::string::size_type &s, std::string::si
|
||||
|
||||
do
|
||||
{
|
||||
e = str.find("'", s);
|
||||
e = str.find('\'', s);
|
||||
if (e == std::string::npos) return false;
|
||||
} while (str[e-1] == '\\');
|
||||
|
||||
@@ -100,7 +100,7 @@ bool findnth(std::string &str, int n, std::string::size_type &s, std::string::si
|
||||
do
|
||||
{
|
||||
s = e+4;
|
||||
e = str.find("'", s);
|
||||
e = str.find('\'', s);
|
||||
if (e == std::string::npos) return false;
|
||||
} while (str[e-1] == '\\');
|
||||
}
|
||||
@@ -202,14 +202,14 @@ std::string CreateDumpString(char const* tableName, QueryResult result)
|
||||
Field *fields = result->Fetch();
|
||||
for (uint32 i = 0; i < result->GetFieldCount(); ++i)
|
||||
{
|
||||
if (i == 0) ss << "'";
|
||||
if (i == 0) ss << '\'';
|
||||
else ss << ", '";
|
||||
|
||||
std::string s = fields[i].GetString();
|
||||
CharacterDatabase.EscapeString(s);
|
||||
ss << s;
|
||||
|
||||
ss << "'";
|
||||
ss << '\'';
|
||||
}
|
||||
ss << ");";
|
||||
return ss.str();
|
||||
@@ -218,7 +218,7 @@ std::string CreateDumpString(char const* tableName, QueryResult result)
|
||||
std::string PlayerDumpWriter::GenerateWhereStr(char const* field, uint32 guid)
|
||||
{
|
||||
std::ostringstream wherestr;
|
||||
wherestr << field << " = '" << guid << "'";
|
||||
wherestr << field << " = '" << guid << '\'';
|
||||
return wherestr.str();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user