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

Prefer snprintf() over sprintf() #7709

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rubiefawn
Copy link
Contributor

Resolves #3949 by replacing all calls to sprintf() in first-party code (read: not in a git submodule or src/3rdparty) with calls to snprintf() or some other reasonable alternative.

This does not resolve the memory management issue raised in this comment; it only addresses the uses of sprintf().

This replaces all calls to sprintf() in first-party code with calls to
snprintf() or some other reasonable alternative.
Remove bitmask, since the format specifier already restricts the output
to 2 characters per byte
I used a different name in my test code to make sure my method was
working properly and forgot to change the name back. Fixed!
@sakertooth
Copy link
Contributor

I'd be reluctant to change anything in MidiImport/portsmf. This seems to be a third party library that wasn't pulled into as a Git submodule for some reason.

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.

Audit/replace use of sprintf() and friends...
2 participants