Re-added BSD string functions

This commit is contained in:
2023-05-01 08:10:00 +03:00
parent a04cd735de
commit 19cc2f3e34
61 changed files with 308 additions and 297 deletions

View File

@@ -19,7 +19,7 @@ void CClientManager::LoadEventFlag()
while ((row = mysql_fetch_row(pRes->pSQLResult)))
{
TPacketSetEventFlag p;
strncpy(p.szFlagName, row[0], sizeof(p.szFlagName));
strlcpy(p.szFlagName, row[0], sizeof(p.szFlagName));
str_to_number(p.lValue, row[1]);
sys_log(0, "EventFlag Load %s %d", p.szFlagName, p.lValue);
m_map_lEventFlag.insert(std::make_pair(std::string(p.szFlagName), p.lValue));
@@ -68,7 +68,7 @@ void CClientManager::SendEventFlagsOnSetup(CPeer* peer)
for (it = m_map_lEventFlag.begin(); it != m_map_lEventFlag.end(); ++it)
{
TPacketSetEventFlag p;
strncpy(p.szFlagName, it->first.c_str(), sizeof(p.szFlagName));
strlcpy(p.szFlagName, it->first.c_str(), sizeof(p.szFlagName));
p.lValue = it->second;
peer->EncodeHeader(HEADER_DG_SET_EVENT_FLAG, 0, sizeof(TPacketSetEventFlag));
peer->Encode(&p, sizeof(TPacketSetEventFlag));