mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Use strncpy instead of strcpy because again, buffer overflows
This commit is contained in:
parent
7769da9434
commit
79c34c68db
92 changed files with 298 additions and 279 deletions
|
|
@ -194,7 +194,7 @@ char* afxRPGMagicSpellData::fmt_placeholder_desc(char* buffer, int len) const
|
|||
{
|
||||
char pack_str[32];
|
||||
if (source_pack == ST_NULLSTRING)
|
||||
dStrcpy(pack_str, "unknown");
|
||||
dStrcpy(pack_str, "unknown", 32);
|
||||
else
|
||||
dSprintf(pack_str, 32, "%s", source_pack);
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ char* afxRPGMagicSpellData::formatDesc(char* buffer, int len) const
|
|||
{
|
||||
if (spell_target != TARGET_NOTHING)
|
||||
{
|
||||
dStrcpy(target_str, _afxRPGMagicSpell_TargetType::_sEnumTable[i].mName);
|
||||
dStrcpy(target_str, _afxRPGMagicSpell_TargetType::_sEnumTable[i].mName, 32);
|
||||
if (spell_target != TARGET_FREE && target_optional)
|
||||
dStrcat(target_str, " (opt)", 32);
|
||||
}
|
||||
|
|
@ -245,13 +245,13 @@ char* afxRPGMagicSpellData::formatDesc(char* buffer, int len) const
|
|||
|
||||
char casting_str[32];
|
||||
if (casting_dur <= 0)
|
||||
dStrcpy(casting_str, "instant");
|
||||
dStrcpy(casting_str, "instant", 32);
|
||||
else
|
||||
dSprintf(casting_str, 32, "%.1f sec cast", casting_dur);
|
||||
|
||||
char pack_str[32];
|
||||
if (source_pack == ST_NULLSTRING)
|
||||
dStrcpy(pack_str, "unknown");
|
||||
dStrcpy(pack_str, "unknown", 32);
|
||||
else
|
||||
dSprintf(pack_str, 32, "%s", source_pack);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue