diff --git a/src/core/diags/factory_diags.cpp b/src/core/diags/factory_diags.cpp index 5cb0d9a69..03ba1d7c1 100644 --- a/src/core/diags/factory_diags.cpp +++ b/src/core/diags/factory_diags.cpp @@ -475,15 +475,7 @@ exit: { case OT_ERROR_NONE: - if (argCount >= 1) - { - ProcessCmd(argCount - 1, (argCount == 1) ? NULL : &argVector[1], aOutput, aOutputMaxLen); - } - else - { - ProcessCmd(0, NULL, aOutput, aOutputMaxLen); - } - + ProcessCmd(argCount, &argVector[0], aOutput, aOutputMaxLen); break; case OT_ERROR_NO_BUFS: diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index b5702a2c9..84acfdfdb 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -1288,6 +1288,16 @@ otError NcpBase::HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG(uint8_t aHeader) VerifyOrExit(error == OT_ERROR_NONE, error = WriteLastStatusFrame(aHeader, ThreadErrorToSpinelStatus(error))); output[sizeof(output) - 1] = '\0'; + +#if OPENTHREAD_MTD || OPENTHREAD_FTD + // TODO do not pass mfg prefix + // skip mfg prefix from wpantund + if (memcmp(string, "mfg ", 4) == 0) + { + string += 4; + } +#endif + otDiagProcessCmdLine(mInstance, string, output, sizeof(output) - 1); // Prepare the response