diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index e55bf4e9d..7e816b2b1 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -1923,15 +1923,16 @@ void Interpreter::ProcessPing(int argc, char *argv[]) switch (index) { case 1: - mLength = (uint16_t)value; + mLength = static_cast(value); break; case 2: - mCount = (uint16_t)value; + mCount = static_cast(value); break; case 3: - mInterval = (uint32_t)value; + mInterval = static_cast(value); + VerifyOrExit(mInterval <= Timer::kMaxDt, error = OT_ERROR_INVALID_ARGS); mInterval = mInterval * 1000; break;