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

Correct use of strncpy function #1247

Merged
merged 1 commit into from Sep 15, 2018
Merged

Conversation

brookst
Copy link
Contributor

@brookst brookst commented Sep 13, 2018

Fix the -Wstringop-overflow warning on GCC, similar to #1243

The last argument should be the max size of the destination, not the
source buffer. A null byte is added to the end of the destination buffer
since strncpy only adds one if it does not truncate the source.

The last argument should be the max size of the destination, not the
source buffer. A null byte is added to the end of the destination buffer
since strncpy only adds one if it does not truncate the source.
This fixes the -Wstringop-overflow warning on GCC.
@aquynh aquynh merged commit e2c1cd4 into capstone-engine:master Sep 15, 2018
@aquynh
Copy link
Collaborator

aquynh commented Sep 15, 2018

merged, thanks!

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