mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 16:56:07 +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:
@@ -188,7 +188,7 @@ std::string GetScriptCommandName(ScriptCommands command)
|
||||
default:
|
||||
{
|
||||
char sz[32];
|
||||
sprintf(sz, "Unknown command: %d", command);
|
||||
snprintf(sz, sizeof(sz), "Unknown command: %d", command);
|
||||
res = sz;
|
||||
break;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ std::string GetScriptCommandName(ScriptCommands command)
|
||||
std::string ScriptInfo::GetDebugInfo() const
|
||||
{
|
||||
char sz[256];
|
||||
sprintf(sz, "%s ('%s' script id: %u)", GetScriptCommandName(command).c_str(), GetScriptsTableNameByType(type).c_str(), id);
|
||||
snprintf(sz, sizeof(sz), "%s ('%s' script id: %u)", GetScriptCommandName(command).c_str(), GetScriptsTableNameByType(type).c_str(), id);
|
||||
return std::string(sz);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user