mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-30 15:22:25 +00:00
Merge branch 'char_to_string' into ErrBuf_char_to_string
This commit is contained in:
commit
b16a0c388b
@ -158,9 +158,10 @@ bool DBcore::RunQuery(const std::string& query, std::string* errbuf, MYSQL_RES**
|
||||
void DBcore::DoEscapeString(std::string& outString, const char* frombuf, uint32 fromlen) {
|
||||
// No good reason to lock the DB, we only need it in the first place to check char encoding.
|
||||
// LockMutex lock(&MDatabase);
|
||||
char* tobuf = new char[sizeof(frombuf)*fromlen*2]();
|
||||
char* tobuf = new char[fromlen*2+1]();
|
||||
unsigned long length = mysql_real_escape_string(&mysql, tobuf, frombuf, fromlen);
|
||||
outString.assign(tobuf,length);
|
||||
outString.resize(length);
|
||||
safe_delete_array(tobuf);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user