mirror of
https://github.com/espressif/openthread.git
synced 2026-09-13 04:30:08 +00:00
[cli] fix false alarm when printing empty line (#6499)
The OpenThread cli may print false alarms when calling
`OutputLine("")`. Fix accordingly.
This commit is contained in:
@@ -332,7 +332,7 @@ static int CliUartOutput(void *aContext, const char *aFormat, va_list aArguments
|
|||||||
if (sTxLength == 0)
|
if (sTxLength == 0)
|
||||||
{
|
{
|
||||||
rval = vsnprintf(sTxBuffer, kTxBufferSize, aFormat, aArguments);
|
rval = vsnprintf(sTxBuffer, kTxBufferSize, aFormat, aArguments);
|
||||||
VerifyOrExit(rval > 0 && rval < kTxBufferSize, otLogWarnPlat("Failed to format CLI output `%s`", aFormat));
|
VerifyOrExit(rval >= 0 && rval < kTxBufferSize, otLogWarnPlat("Failed to format CLI output `%s`", aFormat));
|
||||||
sTxHead = 0;
|
sTxHead = 0;
|
||||||
sTxLength = static_cast<uint16_t>(rval);
|
sTxLength = static_cast<uint16_t>(rval);
|
||||||
sSendLength = 0;
|
sSendLength = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user