diff --git a/src/cli/cli_coap.cpp b/src/cli/cli_coap.cpp index 545555f4e..2828a32b5 100644 --- a/src/cli/cli_coap.cpp +++ b/src/cli/cli_coap.cpp @@ -143,13 +143,12 @@ otError Coap::ProcessStop(int argc, char *argv[]) otError Coap::ProcessParameters(int argc, char *argv[]) { - otError error = OT_ERROR_NONE; - - VerifyOrExit(argc > 0, error = OT_ERROR_INVALID_ARGS); - + otError error = OT_ERROR_NONE; bool * defaultTxParameters; otCoapTxParameters *txParameters; + VerifyOrExit(argc > 1, error = OT_ERROR_INVALID_ARGS); + if (strcmp(argv[1], "request") == 0) { txParameters = &mRequestTxParameters;