mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
fix: clang warning about deprecated sprintf usage (#4747)
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 #4569
This commit is contained in:
committed by
GitHub
parent
d9f90c84c0
commit
5a7af5bb77
@@ -922,10 +922,8 @@ Reader::getLocationLineAndColumn(Location location) const
|
||||
{
|
||||
int line, column;
|
||||
getLocationLineAndColumn(location, line, column);
|
||||
constexpr std::size_t n = 18 + 16 + 16 + 1;
|
||||
char buffer[n];
|
||||
snprintf(buffer, n, "Line %d, Column %d", line, column);
|
||||
return buffer;
|
||||
return "Line " + std::to_string(line) + ", Column " +
|
||||
std::to_string(column);
|
||||
}
|
||||
|
||||
std::string
|
||||
|
||||
Reference in New Issue
Block a user