-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
clang warning about deprecated sprintf usage #4747
Conversation
@intelliot @a-noni-mousse @seelabs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Change looks good. The changed line is also exercised by the unit tests, which increases my confidence..
char buffer[n]; | ||
snprintf(buffer, n, "Line %d, Column %d", line, column); | ||
return buffer; | ||
return "Line " + std::to_string(line) + ", Column " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that you kept the form of the string formatting similar to the other string formatting in the file.
|
Resolves a warning that was emitted from the clang compiler. Switches usage of the sprintf function to the recommended snprintf function. Warning was observed in Apple clang version 15.0.0 (clang-1500.0.40.1). Fix XRPLF#4569
High Level Overview of Change
This fix is intended to remove a warning from the clang compiler. It switches the usage of sprintf function into the recommended snprintf function.
I observed this issue in this environment:
Fix #4569
Context of Change
Type of Change