From 75a382d292b2271c0a6e202324550091753467f0 Mon Sep 17 00:00:00 2001 From: Moandor Date: Wed, 27 May 2020 01:26:34 +0800 Subject: [PATCH] [cli] fix argument parsing for counters command (#5004) This fixes the argument parsing for counters command. The lines calling otLinkResetCounters and otThreadResetMleCounters are unreachable and this fixes it. --- src/cli/cli.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 5d116efac..ccec36f2b 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -1136,7 +1136,7 @@ void Interpreter::ProcessCounters(uint8_t aArgsLength, char *aArgs[]) mServer->OutputFormat(" RxErrFcs: %d\r\n", macCounters->mRxErrFcs); mServer->OutputFormat(" RxErrOther: %d\r\n", macCounters->mRxErrOther); } - else if ((aArgsLength == 2) && (strcmp(aArgs[0], "reset") == 0)) + else if ((aArgsLength == 2) && (strcmp(aArgs[1], "reset") == 0)) { otLinkResetCounters(mInstance); } @@ -1162,7 +1162,7 @@ void Interpreter::ProcessCounters(uint8_t aArgsLength, char *aArgs[]) mleCounters->mBetterPartitionAttachAttempts); mServer->OutputFormat("Parent Changes: %d\r\n", mleCounters->mParentChanges); } - else if ((aArgsLength == 2) && (strcmp(aArgs[0], "reset") == 0)) + else if ((aArgsLength == 2) && (strcmp(aArgs[1], "reset") == 0)) { otThreadResetMleCounters(mInstance); }