From bcd4b83e1666f1160514546ebf4e474938f424b7 Mon Sep 17 00:00:00 2001 From: shuhua hua Date: Tue, 3 Sep 2024 06:00:48 +0000 Subject: [PATCH] Ignore empty user names as input * To unify the surrounding coding style --- cpukit/libmisc/shell/login_prompt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpukit/libmisc/shell/login_prompt.c b/cpukit/libmisc/shell/login_prompt.c index 149966be63..4935480576 100644 --- a/cpukit/libmisc/shell/login_prompt.c +++ b/cpukit/libmisc/shell/login_prompt.c @@ -69,7 +69,7 @@ #include #include #include - +#include #include static int rtems_shell_discard( int c, FILE *stream) @@ -177,6 +177,8 @@ bool rtems_shell_login_prompt( result = rtems_shell_get_text( in, out, user, sizeof(user) ); if ( !result ) break; + if (0 == strlen(user)) + continue; fflush( in); fprintf( out, "Password: ");