From 093c8106546d9478aa571db97f4f0507f7432b86 Mon Sep 17 00:00:00 2001 From: Chenna Keshava Date: Wed, 4 Oct 2023 13:14:53 -0700 Subject: [PATCH] fix XRPLF#4569: clang warning about deprecated sprintf usage --- src/ripple/json/impl/json_reader.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ripple/json/impl/json_reader.cpp b/src/ripple/json/impl/json_reader.cpp index e4124e9bc8f..299accd84a8 100644 --- a/src/ripple/json/impl/json_reader.cpp +++ b/src/ripple/json/impl/json_reader.cpp @@ -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