[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.
This commit is contained in:
Moandor
2020-05-27 01:26:34 +08:00
committed by GitHub
parent 9a3c2dc3b3
commit 75a382d292
+2 -2
View File
@@ -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);
}