Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rmodels] LoadBoneInfoGLTF(), add check for animation name being NULL #4053

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

VitoTringolo
Copy link
Contributor

src/rmodels.c Outdated
@@ -4864,7 +4864,9 @@ static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount)
for (unsigned int i = 0; i < skin.joints_count; i++)
{
cgltf_node node = *skin.joints[i];
strncpy(bones[i].name, node.name, sizeof(bones[i].name));
if (node.name != NULL) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, could you avoid the brackets, in raylib one line statements use no-brackets:

if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! And sorry, I missed this code convention!

@raysan5 raysan5 changed the title LoadBoneInfoGLTF add check for animation name being NULL [rmodels] LoadBoneInfoGLTF(), add check for animation name being NULL Jun 10, 2024
@VitoTringolo VitoTringolo force-pushed the gltf-bone-null-check branch from a5224f6 to 00d7e8c Compare June 11, 2024 09:10
@raysan5 raysan5 merged commit 0fc4b61 into raysan5:master Jun 11, 2024
@raysan5
Copy link
Owner

raysan5 commented Jun 11, 2024

@VitoTringolo thanks for the review!

@VitoTringolo VitoTringolo deleted the gltf-bone-null-check branch June 30, 2024 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants