diff --git a/system/nxlooper/nxlooper_main.c b/system/nxlooper/nxlooper_main.c index 7650b94cf..ec4cd5601 100644 --- a/system/nxlooper/nxlooper_main.c +++ b/system/nxlooper/nxlooper_main.c @@ -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 */ diff --git a/system/nxplayer/nxplayer_main.c b/system/nxplayer/nxplayer_main.c index ef62d7f96..f7d9145f3 100644 --- a/system/nxplayer/nxplayer_main.c +++ b/system/nxplayer/nxplayer_main.c @@ -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 */ diff --git a/system/nxrecorder/nxrecorder_main.c b/system/nxrecorder/nxrecorder_main.c index 5e548cb12..b5eb5fd37 100644 --- a/system/nxrecorder/nxrecorder_main.c +++ b/system/nxrecorder/nxrecorder_main.c @@ -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 */