Skip to content

Refactor strlcpy for strcpy with a static_assert where possible in WWVegas #1828

@Skyaero42

Description

@Skyaero42

Something is wrong with the following line. Perhaps this was meant to be strcpy. Buffer has same length as TGA2_SIGNATURE.

strlcpy(footer.Signature, TGA2_SIGNATURE, sizeof(footer.Signature));

There are more copies that can use static_assert's instead.

strlcpy(Name,w3d_data.Name,sizeof(Name));
strlcpy(header.Name,AnimName,sizeof(header.Name));
strlcpy(header.HierarchyName,HierarchyName,sizeof(header.HierarchyName));
strlcpy(Name, aheader.HierarchyName, ARRAY_SIZE(Name));
strlcat(Name, ".", ARRAY_SIZE(Name));
strlcat(Name, aheader.Name, ARRAY_SIZE(Name));
strlcpy(HierarchyName,aheader.HierarchyName,W3D_NAME_LEN);

WWVegas code needs another review pass to use static_assert + strcpy instead of strlcpy where so possible.

Metadata

Metadata

Assignees

Labels

PerformanceIs a performance concernStabilityConcerns stability of the runtime

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions