Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWLib/TARGA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ long Targa::Save(const char* name, long flags, bool addextension)
if (!error) {

mExtension.ExtSize = 495;
strlcpy(mExtension.SoftID, "Denzil's Targa Code", sizeof(mExtension.SoftID));
strcpy(mExtension.SoftID, "Denzil's Targa Code");
mExtension.SoftVer.Number = (1 * 100);
mExtension.SoftVer.Letter = 0;

Expand Down
3 changes: 2 additions & 1 deletion Generals/Code/GameEngine/Source/Common/INI/INI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ UnsignedInt INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer )
if (parse)
{
#ifdef DEBUG_CRASHING
strlcpy(m_curBlockStart, m_buffer, ARRAY_SIZE(m_curBlockStart));
static_assert(ARRAY_SIZE(m_curBlockStart) >= ARRAY_SIZE(m_buffer), "Incorrect array size");
strcpy(m_curBlockStart, m_buffer);
#endif
try {
(*parse)( this );
Expand Down
3 changes: 2 additions & 1 deletion Generals/Code/GameEngine/Source/Common/PerfTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ void PerfGather::reset()
strlcpy(s_buf, fname, ARRAY_SIZE(s_buf);

char tmp[256];
strlcpy(tmp, s_buf, ARRAY_SIZE(tmp));
static_assert(ARRAY_SIZE(tmp) >= ARRAY_SIZE(s_buf), "Incorrect array size");
strcpy(tmp, s_buf);
strlcat(tmp, ".csv", ARRAY_SIZE(tmp));

s_perfStatsFile = fopen(tmp, "w");
Expand Down
6 changes: 4 additions & 2 deletions Generals/Code/Libraries/Source/WWVegas/WW3D2/hmorphanim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,10 @@ int HMorphAnimClass::Save_W3D(ChunkSaveClass & csave)

// init the header data
W3dMorphAnimHeaderStruct header;
strlcpy(header.Name,AnimName,sizeof(header.Name));
strlcpy(header.HierarchyName,HierarchyName,sizeof(header.HierarchyName));
static_assert(ARRAY_SIZE(header.Name) >= ARRAY_SIZE(AnimName), "Incorrect array size");
static_assert(ARRAY_SIZE(header.HierarchyName) >= ARRAY_SIZE(HierarchyName), "Incorrect array size");
strcpy(header.Name, AnimName);
strcpy(header.HierarchyName, HierarchyName);

header.FrameCount = FrameCount;
header.FrameRate = FrameRate;
Expand Down
10 changes: 4 additions & 6 deletions Generals/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,13 @@ int HRawAnimClass::Load_W3D(ChunkLoadClass & cload)
pre30 = true;
}

strlcpy(Name, aheader.HierarchyName, ARRAY_SIZE(Name));
static_assert(ARRAY_SIZE(Name) >= ARRAY_SIZE(aheader.HierarchyName), "Incorrect array size");
strcpy(Name, aheader.HierarchyName);
strlcat(Name, ".", ARRAY_SIZE(Name));
strlcat(Name, aheader.Name, ARRAY_SIZE(Name));

// TSS chasing crash bug 05/26/99
WWASSERT(HierarchyName != NULL);
WWASSERT(aheader.HierarchyName != NULL);
WWASSERT(sizeof(HierarchyName) >= W3D_NAME_LEN);
strlcpy(HierarchyName,aheader.HierarchyName,W3D_NAME_LEN);
static_assert(ARRAY_SIZE(HierarchyName) >= ARRAY_SIZE(aheader.HierarchyName), "Incorrect array size");
strcpy(HierarchyName, aheader.HierarchyName);

HTreeClass * base_pose = WW3DAssetManager::Get_Instance()->Get_HTree(HierarchyName);
if (base_pose == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Include/Common/INI.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,6 @@ class INI
const char *m_blockEndToken; ///< token to represent end of data block
Bool m_endOfFile; ///< TRUE when we've hit EOF
#ifdef DEBUG_CRASHING
char m_curBlockStart[ INI_MAX_CHARS_PER_LINE ]; ///< first line of cur block
char m_curBlockStart[ INI_MAX_CHARS_PER_LINE+1 ]; ///< first line of cur block
#endif
};
3 changes: 2 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ UnsignedInt INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer )
if (parse)
{
#ifdef DEBUG_CRASHING
strlcpy(m_curBlockStart, m_buffer, ARRAY_SIZE(m_curBlockStart));
static_assert(ARRAY_SIZE(m_curBlockStart) >= ARRAY_SIZE(m_buffer), "Incorrect array size");
strcpy(m_curBlockStart, m_buffer);
#endif
try {
(*parse)( this );
Expand Down
3 changes: 2 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ void PerfGather::reset()
strlcpy(s_buf, fname, ARRAY_SIZE(s_buf);

char tmp[256];
strlcpy(tmp, s_buf, ARRAY_SIZE(tmp));
static_assert(ARRAY_SIZE(tmp) >= ARRAY_SIZE(s_buf), "Incorrect array size");
strcpy(tmp, s_buf);
strlcat(tmp, ".csv", ARRAY_SIZE(tmp));

s_perfStatsFile = fopen(tmp, "w");
Expand Down
6 changes: 4 additions & 2 deletions GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hmorphanim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,10 @@ int HMorphAnimClass::Save_W3D(ChunkSaveClass & csave)

// init the header data
W3dMorphAnimHeaderStruct header;
strlcpy(header.Name,AnimName,sizeof(header.Name));
strlcpy(header.HierarchyName,HierarchyName,sizeof(header.HierarchyName));
static_assert(ARRAY_SIZE(header.Name) >= ARRAY_SIZE(AnimName), "Incorrect array size");
static_assert(ARRAY_SIZE(header.HierarchyName) >= ARRAY_SIZE(HierarchyName), "Incorrect array size");
strcpy(header.Name, AnimName);
strcpy(header.HierarchyName, HierarchyName);

header.FrameCount = FrameCount;
header.FrameRate = FrameRate;
Expand Down
10 changes: 4 additions & 6 deletions GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,13 @@ int HRawAnimClass::Load_W3D(ChunkLoadClass & cload)
pre30 = true;
}

strlcpy(Name, aheader.HierarchyName, ARRAY_SIZE(Name));
static_assert(ARRAY_SIZE(Name) >= ARRAY_SIZE(aheader.HierarchyName), "Incorrect array size");
strcpy(Name, aheader.HierarchyName);
strlcat(Name, ".", ARRAY_SIZE(Name));
strlcat(Name, aheader.Name, ARRAY_SIZE(Name));

// TSS chasing crash bug 05/26/99
WWASSERT(HierarchyName != NULL);
WWASSERT(aheader.HierarchyName != NULL);
WWASSERT(sizeof(HierarchyName) >= W3D_NAME_LEN);
strlcpy(HierarchyName,aheader.HierarchyName,W3D_NAME_LEN);
static_assert(ARRAY_SIZE(HierarchyName) >= ARRAY_SIZE(aheader.HierarchyName), "Incorrect array size");
strcpy(HierarchyName, aheader.HierarchyName);

HTreeClass * base_pose = WW3DAssetManager::Get_Instance()->Get_HTree(HierarchyName);
if (base_pose == NULL) {
Expand Down
Loading