mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Merge pull request #1283 from EQEmu/cleanup/Wformat-overflow
[Cleanup] Make code -Wformat-overflow safe
This commit is contained in:
+6
-1
@@ -4791,7 +4791,12 @@ Merc* Merc::LoadMerc(Client *c, MercTemplate* merc_template, uint32 merchant_id,
|
||||
tmpsize = c->GetMercInfo().MercSize;
|
||||
}
|
||||
|
||||
sprintf(npc_type->lastname, "%s's Mercenary", c->GetName());
|
||||
std::string tmp_lastname = c->GetName();
|
||||
tmp_lastname += "'s Mercenary";
|
||||
|
||||
// not sure what to do if too long
|
||||
if (tmp_lastname.length() < sizeof(npc_type->lastname))
|
||||
strn0cpy(npc_type->lastname, tmp_lastname.c_str(), sizeof(npc_type->lastname));
|
||||
npc_type->gender = tmpgender;
|
||||
npc_type->size = tmpsize;
|
||||
npc_type->loottable_id = 0; // Loottable has to be 0, otherwise we'll be leavin' some corpses!
|
||||
|
||||
Reference in New Issue
Block a user