std::strncpy back to strlcpy

This commit is contained in:
d1str4ught
2025-08-22 17:45:31 +02:00
parent 5c9ae80bcd
commit 920a3fc861
59 changed files with 309 additions and 309 deletions

View File

@@ -151,7 +151,7 @@ void CItem::EncodeInsertPacket(LPENTITY ent)
p.bHeader = HEADER_GC_ITEM_OWNERSHIP;
p.dwVID = m_dwVID;
std::strncpy(p.szName, info->szOwnerName, sizeof(p.szName));
strlcpy(p.szName, info->szOwnerName, sizeof(p.szName));
d->Packet(&p, sizeof(TPacketGCItemOwnership));
}
@@ -1147,7 +1147,7 @@ void CItem::SetOwnership(LPCHARACTER ch, int iSec)
m_dwOwnershipPID = ch->GetPlayerID();
item_event_info* info = AllocEventInfo<item_event_info>();
std::strncpy(info->szOwnerName, ch->GetName(), sizeof(info->szOwnerName));
strlcpy(info->szOwnerName, ch->GetName(), sizeof(info->szOwnerName));
info->item = this;
SetOwnershipEvent(event_create(ownership_event, info, PASSES_PER_SEC(iSec)));
@@ -1156,7 +1156,7 @@ void CItem::SetOwnership(LPCHARACTER ch, int iSec)
p.bHeader = HEADER_GC_ITEM_OWNERSHIP;
p.dwVID = m_dwVID;
std::strncpy(p.szName, ch->GetName(), sizeof(p.szName));
strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
PacketAround(&p, sizeof(p));
}