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

Replace various sprintf with snprintf #231

Merged
merged 2 commits into from
Feb 7, 2024
Merged

Replace various sprintf with snprintf #231

merged 2 commits into from
Feb 7, 2024

Conversation

seanm
Copy link
Contributor

@seanm seanm commented Jan 31, 2024

snprintf is safer because the buffer length is specified, so can't be overrun.

tools/matdump.c Fixed Show resolved Hide resolved
@seanm seanm force-pushed the snprintf branch 2 times, most recently from a6a5325 to c99ce89 Compare February 4, 2024 23:35
@tbeu tbeu force-pushed the snprintf branch 4 times, most recently from 2208c66 to 2dcb770 Compare February 5, 2024 20:30
@tbeu tbeu changed the title Replaced various sprintf with snprintf Replace various sprintf with snprintf Feb 5, 2024
@seanm
Copy link
Contributor Author

seanm commented Feb 5, 2024

@tbeu ah, I suppose this is to support old MS compilers, that did not support C99 properly?

@tbeu
Copy link
Owner

tbeu commented Feb 5, 2024

@tbeu ah, I suppose this is to support old MS compilers, that did not support C99 properly?

Exactly. AppVeyor (and my local VS setup) could not build your initial change.

@tbeu tbeu force-pushed the snprintf branch 2 times, most recently from a82d980 to 0e68c4a Compare February 6, 2024 05:33
seanm and others added 2 commits February 7, 2024 19:06
snprintf is safer because the buffer length is specified, so can't be overrun.
@tbeu tbeu merged commit 4fb8be7 into tbeu:master Feb 7, 2024
2 of 5 checks passed
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.

2 participants