From 6fa74b7674154733d0934e2deee0860743b9ee5d Mon Sep 17 00:00:00 2001 From: Jiacheng Guo Date: Thu, 22 Apr 2021 13:16:04 +0800 Subject: [PATCH] [cli] fix false alarm when printing empty line (#6499) The OpenThread cli may print false alarms when calling `OutputLine("")`. Fix accordingly. --- examples/apps/cli/cli_uart.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/apps/cli/cli_uart.cpp b/examples/apps/cli/cli_uart.cpp index 0f3e54197..b2d271dcc 100644 --- a/examples/apps/cli/cli_uart.cpp +++ b/examples/apps/cli/cli_uart.cpp @@ -332,7 +332,7 @@ static int CliUartOutput(void *aContext, const char *aFormat, va_list aArguments if (sTxLength == 0) { 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; sTxLength = static_cast(rval); sSendLength = 0;