nxlooper nxplayer nxrecorder: fix coverity bug

readline might return EOF.

Signed-off-by: jihandong <jihandong@xiaomi.com>
This commit is contained in:
jihandong 2022-05-07 16:06:39 +08:00 committed by Xiang Xiao
parent de26582775
commit 6afc226350
3 changed files with 3 additions and 3 deletions

View File

@ -528,9 +528,9 @@ int main(int argc, FAR char *argv[])
/* Read a line from the terminal */
len = readline(buffer, sizeof(buffer), stdin, stdout);
buffer[len] = '\0';
if (len > 0)
{
buffer[len] = '\0';
if (strncmp(buffer, "!", 1) != 0)
{
/* nxlooper command */

View File

@ -771,9 +771,9 @@ int main(int argc, FAR char *argv[])
/* Read a line from the terminal */
len = readline(buffer, sizeof(buffer), stdin, stdout);
buffer[len] = '\0';
if (len > 0)
{
buffer[len] = '\0';
if (strncmp(buffer, "!", 1) != 0)
{
/* nxplayer command */

View File

@ -484,9 +484,9 @@ int main(int argc, FAR char *argv[])
/* Read a line from the terminal */
len = readline(buffer, sizeof(buffer), stdin, stdout);
buffer[len] = '\0';
if (len > 0)
{
buffer[len] = '\0';
if (strncmp(buffer, "!", 1) != 0)
{
/* nxrecorder command */