diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 81205ad1b..e229a88dc 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -337,7 +337,7 @@ otError Interpreter::ProcessHelp(uint8_t aArgsLength, char *aArgs[]) for (uint8_t i = 0; i < mUserCommandsLength; i++) { - OutputLine(mUserCommands[i].mName); + OutputLine("%s", mUserCommands[i].mName); } return OT_ERROR_NONE; @@ -584,7 +584,7 @@ otError Interpreter::ProcessDomainName(uint8_t aArgsLength, char *aArgs[]) if (aArgsLength == 0) { - OutputLine(otThreadGetDomainName(mInstance)); + OutputLine("%s", otThreadGetDomainName(mInstance)); } else { @@ -2426,7 +2426,7 @@ otError Interpreter::ProcessNetworkName(uint8_t aArgsLength, char *aArgs[]) if (aArgsLength == 0) { - OutputLine(otThreadGetNetworkName(mInstance)); + OutputLine("%s", otThreadGetNetworkName(mInstance)); } else { @@ -3042,7 +3042,7 @@ otError Interpreter::ProcessRcp(uint8_t aArgsLength, char *aArgs[]) if (strcmp(aArgs[0], "version") == 0) { - OutputLine(version); + OutputLine("%s", version); } else { @@ -3774,7 +3774,7 @@ otError Interpreter::ProcessVersion(uint8_t aArgsLength, char *aArgs[]) if (aArgsLength == 0) { - OutputLine(otGetVersionString()); + OutputLine("%s", otGetVersionString()); ExitNow(); } diff --git a/src/cli/cli_coap.cpp b/src/cli/cli_coap.cpp index b23e13369..945d809ec 100644 --- a/src/cli/cli_coap.cpp +++ b/src/cli/cli_coap.cpp @@ -197,7 +197,7 @@ otError Coap::ProcessResource(uint8_t aArgsLength, char *aArgs[]) } else { - mInterpreter.OutputLine(mResource.mUriPath != nullptr ? mResource.mUriPath : ""); + mInterpreter.OutputLine("%s", mResource.mUriPath != nullptr ? mResource.mUriPath : ""); } exit: @@ -251,7 +251,7 @@ otError Coap::ProcessSet(uint8_t aArgsLength, char *aArgs[]) } else { - mInterpreter.OutputLine(mResourceContent); + mInterpreter.OutputLine("%s", mResourceContent); } exit: diff --git a/src/cli/cli_coap_secure.cpp b/src/cli/cli_coap_secure.cpp index 4e2eec0ff..0e4535fcb 100644 --- a/src/cli/cli_coap_secure.cpp +++ b/src/cli/cli_coap_secure.cpp @@ -130,7 +130,7 @@ otError CoapSecure::ProcessResource(uint8_t aArgsLength, char *aArgs[]) } else { - mInterpreter.OutputLine(mResource.mUriPath != nullptr ? mResource.mUriPath : ""); + mInterpreter.OutputLine("%s", mResource.mUriPath != nullptr ? mResource.mUriPath : ""); } exit: @@ -149,7 +149,7 @@ otError CoapSecure::ProcessSet(uint8_t aArgsLength, char *aArgs[]) } else { - mInterpreter.OutputLine(mResourceContent); + mInterpreter.OutputLine("%s", mResourceContent); } exit: diff --git a/src/cli/cli_udp.cpp b/src/cli/cli_udp.cpp index ab2d01a8f..b7a22cb92 100644 --- a/src/cli/cli_udp.cpp +++ b/src/cli/cli_udp.cpp @@ -327,7 +327,7 @@ void UdpExample::HandleUdpReceive(otMessage *aMessage, const otMessageInfo *aMes length = otMessageRead(aMessage, otMessageGetOffset(aMessage), buf, sizeof(buf) - 1); buf[length] = '\0'; - mInterpreter.OutputLine(buf); + mInterpreter.OutputLine("%s", buf); } } // namespace Cli