mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 00:06:11 +00:00
fix (core): macos12 depreciation workflow error / security CWE-120 (#14746)
* fix (core): macos12 depreciation workflow error
Fix workflow error message:
azerothcore-wotlk/src/common/Utilities/Util.cpp:558:9: fatal error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(buffer, "%02X", bytes[i]);
* Update BattlegroundAV.cpp
* more macos12 fixit
* Update spell_generic.cpp
This commit is contained in:
@@ -438,7 +438,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
|
||||
if (Creature* herald = me->FindNearestCreature(NPC_DARK_IRON_HERALD, 100.0f))
|
||||
{
|
||||
char amount[500];
|
||||
sprintf(amount, "We did it boys! Now back to the Grim Guzzler and we'll drink to the %u that were injured!", guzzlerCounter);
|
||||
snprintf(amount, sizeof(amount), "We did it boys! Now back to the Grim Guzzler and we'll drink to the %u that were injured!", guzzlerCounter);
|
||||
herald->Yell(amount, LANG_UNIVERSAL);
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
|
||||
if (Creature* herald = me->FindNearestCreature(NPC_DARK_IRON_HERALD, 100.0f))
|
||||
{
|
||||
char amount[500];
|
||||
sprintf(amount, "RETREAT!! We've already lost %u and we can't afford to lose any more!!", guzzlerCounter);
|
||||
snprintf(amount, sizeof(amount), "RETREAT!! We've already lost %u and we can't afford to lose any more!!", guzzlerCounter);
|
||||
herald->Yell(amount, LANG_UNIVERSAL);
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 55.0f, true) )
|
||||
{
|
||||
char buffer[100];
|
||||
sprintf(buffer, "Eadric the Pure targets %s with the Hammer of the Righteous!", target->GetName().c_str());
|
||||
snprintf(buffer, sizeof(buffer), "Eadric the Pure targets %s with the Hammer of the Righteous!", target->GetName().c_str());
|
||||
me->TextEmote(buffer, nullptr, true);
|
||||
Talk(TEXT_EADRIC_HAMMER);
|
||||
me->CastSpell(target, SPELL_HAMMER_JUSTICE, true);
|
||||
|
||||
@@ -654,7 +654,7 @@ public:
|
||||
case SPELL_TRAMPLE_STUN:
|
||||
{
|
||||
char buffer[50];
|
||||
sprintf(buffer, "%s is trampled!", me->GetName().c_str());
|
||||
snprintf(buffer, sizeof(buffer), "%s is trampled!", me->GetName().c_str());
|
||||
me->TextEmote(buffer);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -152,7 +152,7 @@ class boss_archavon : public CreatureScript
|
||||
case EVENT_STOMP:
|
||||
{
|
||||
char buffer[100];
|
||||
sprintf(buffer, "Archavon the Stone Watcher lunges for %s!", me->GetVictim()->GetName().c_str());
|
||||
snprintf(buffer, sizeof(buffer), "Archavon the Stone Watcher lunges for %s!", me->GetVictim()->GetName().c_str());
|
||||
me->TextEmote(buffer);
|
||||
|
||||
DoCastVictim(RAID_MODE(SPELL_STOMP_10, SPELL_STOMP_25));
|
||||
|
||||
@@ -137,7 +137,7 @@ class spell_the_flag_of_ownership : public SpellScript
|
||||
return;
|
||||
caster->CastSpell(target, 52605, true);
|
||||
char buff[100];
|
||||
sprintf(buff, "%s plants the Flag of Ownership in the corpse of %s.", caster->GetName().c_str(), target->GetName().c_str());
|
||||
snprintf(buff, sizeof(buff), "%s plants the Flag of Ownership in the corpse of %s.", caster->GetName().c_str(), target->GetName().c_str());
|
||||
caster->TextEmote(buff, caster);
|
||||
haveTarget = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user