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] Fix -Wstringop-truncation warning #4096

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

Peter0x44
Copy link
Contributor

@Peter0x44 Peter0x44 commented Jun 23, 2024

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 strncpy was missing a null terminator write afterwards.

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));
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@raysan5 raysan5 merged commit 4311db5 into raysan5:master Jun 24, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Jun 24, 2024

@Peter0x44 thanks for the review!

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.

None yet

2 participants