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
Convert sprintf to snprintf part 1 #5704
Open
JohnAFernandez
wants to merge
14
commits into
scp-fs2open:master
Choose a base branch
from
JohnAFernandez:Convert-to-snprintf-part-1
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Convert sprintf to snprintf part 1 #5704
JohnAFernandez
wants to merge
14
commits into
scp-fs2open:master
from
JohnAFernandez:Convert-to-snprintf-part-1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JohnAFernandez
added
cleanup
A modification or rewrite of code to make it more understandable or easier to maintain.
sanitizer/stability
Issues caught by Address Sanitizer or other third-party tools.
labels
Oct 22, 2023
JohnAFernandez
force-pushed
the
Convert-to-snprintf-part-1
branch
2 times, most recently
from
October 23, 2023 14:25
ef83637
to
294770e
Compare
As sprintf is deprecated 25 files down, 140 to go
In hud.cpp and freespace.cpp
In 4 more files
in five more files
For 5 more files
And add one more conversion pointed out while checking that it would work.
JohnAFernandez
force-pushed
the
Convert-to-snprintf-part-1
branch
from
December 11, 2023 22:57
90cfdab
to
c4d8982
Compare
I did not see any odd text behavior when I tested this patch. |
JohnAFernandez
added
the
Waiting for Stable
Marks a pull request that is to be merged after the next stable release, due to a release cycle
label
Jan 24, 2024
Goober5000
removed
the
Waiting for Stable
Marks a pull request that is to be merged after the next stable release, due to a release cycle
label
Feb 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cleanup
A modification or rewrite of code to make it more understandable or easier to maintain.
sanitizer/stability
Issues caught by Address Sanitizer or other third-party tools.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This partially addresses a very common warning from clang when compiling FSO that sprintf is deprecated and needs to be converted to snprintf. Now, I don't think the security issues are a huge deal for us, but on the compilation output, it will print out multiple lines for each occurrence, and we use sprintf upwards of 800 times.
This pr converts about a third of them. Note that the SCP_string overload of sprintf is not affected.
In draft until I can do some basic smoke testing. The changes were not complicated, but they are extensive.