From c9522fb740200ccef6230cec452c48efb31e5394 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 11 May 2023 22:05:17 +0200 Subject: Removed all Printf-family functions from StringUtils. Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code. --- src/CommandOutput.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/CommandOutput.cpp') diff --git a/src/CommandOutput.cpp b/src/CommandOutput.cpp index f4e223ed4..0bd549fb0 100644 --- a/src/CommandOutput.cpp +++ b/src/CommandOutput.cpp @@ -10,20 +10,6 @@ -//////////////////////////////////////////////////////////////////////////////// -// cCommandOutputCallback: - -void cCommandOutputCallback::vOut(const char * a_Fmt, fmt::printf_args a_ArgList) -{ - AString Output = ::vPrintf(a_Fmt, a_ArgList); - Output.append("\n"); - Out(Output); -} - - - - - //////////////////////////////////////////////////////////////////////////////// // cStringAccumCommandOutputCallback: @@ -39,7 +25,7 @@ void cStringAccumCommandOutputCallback::Out(const AString & a_Text) //////////////////////////////////////////////////////////////////////////////// // cLogCommandOutputCallback: -void cLogCommandOutputCallback::Finished(void) +void cLogCommandOutputCallback::Finished() { // Log each line separately: size_t len = m_Accum.length(); @@ -50,7 +36,7 @@ void cLogCommandOutputCallback::Finished(void) { case '\n': { - LOG("%s", m_Accum.substr(last, i - last).c_str()); + LOG("%s", m_Accum.substr(last, i - last)); last = i + 1; break; } @@ -58,7 +44,7 @@ void cLogCommandOutputCallback::Finished(void) } // for i - m_Buffer[] if (last < len) { - LOG("%s", m_Accum.substr(last).c_str()); + LOG("%s", m_Accum.substr(last)); } // Clear the buffer for the next command output: -- cgit v1.2.3