From ab7a25faebb9704877dae70befd7233773997328 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Wed, 17 Feb 2021 11:32:12 -0800 Subject: [PATCH] [srp-server] specify format string when printing names (#6179) --- src/cli/cli_srp_server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/cli_srp_server.cpp b/src/cli/cli_srp_server.cpp index a6e3bee47..fb52f7685 100644 --- a/src/cli/cli_srp_server.cpp +++ b/src/cli/cli_srp_server.cpp @@ -72,7 +72,7 @@ otError SrpServer::ProcessDomain(uint8_t aArgsLength, char *aArgs[]) } else { - mInterpreter.OutputLine(otSrpServerGetDomain(mInterpreter.mInstance)); + mInterpreter.OutputLine("%s", otSrpServerGetDomain(mInterpreter.mInstance)); } exit: @@ -135,7 +135,7 @@ otError SrpServer::ProcessHost(uint8_t aArgsLength, char *aArgs[]) uint8_t addressesNum; bool isDeleted = otSrpServerHostIsDeleted(host); - mInterpreter.OutputLine(otSrpServerHostGetFullName(host)); + mInterpreter.OutputLine("%s", otSrpServerHostGetFullName(host)); mInterpreter.OutputLine(Interpreter::kIndentSize, "deleted: %s", isDeleted ? "true" : "false"); if (isDeleted) { @@ -228,7 +228,7 @@ otError SrpServer::ProcessService(uint8_t aArgsLength, char *aArgs[]) { bool isDeleted = otSrpServerServiceIsDeleted(service); - mInterpreter.OutputLine(otSrpServerServiceGetFullName(service)); + mInterpreter.OutputLine("%s", otSrpServerServiceGetFullName(service)); mInterpreter.OutputLine(Interpreter::kIndentSize, "deleted: %s", isDeleted ? "true" : "false"); if (isDeleted) {