Skip to content

Commit

Permalink
nxlooper nxplayer nxrecorder: fix coverity bug
Browse files Browse the repository at this point in the history
readline might return EOF.

Signed-off-by: jihandong <jihandong@xiaomi.com>
  • Loading branch information
jihandong authored and xiaoxiang781216 committed Aug 16, 2022
1 parent de26582 commit 6afc226
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion system/nxlooper/nxlooper_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion system/nxplayer/nxplayer_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion system/nxrecorder/nxrecorder_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 6afc226

Please sign in to comment.