[rmodels] Fix -Wstringop-truncation warning (#4096)
rmodels.c: In function ‘LoadBoneInfoGLTF.isra’: rmodels.c:4874:32: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] 4874 | if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
f947f89061
commit
4311db5ba5
@ -4871,7 +4871,11 @@ static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount)
|
|||||||
for (unsigned int i = 0; i < skin.joints_count; i++)
|
for (unsigned int i = 0; i < skin.joints_count; i++)
|
||||||
{
|
{
|
||||||
cgltf_node node = *skin.joints[i];
|
cgltf_node node = *skin.joints[i];
|
||||||
if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name));
|
if (node.name != NULL)
|
||||||
|
{
|
||||||
|
strncpy(bones[i].name, node.name, sizeof(bones[i].name));
|
||||||
|
bones[i].name[sizeof(bones[i].name) - 1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
// Find parent bone index
|
// Find parent bone index
|
||||||
unsigned int parentIndex = -1;
|
unsigned int parentIndex = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user