[component][at] fix(misc): fix null char input issue

fix issue #7005
This commit is contained in:
wenxingpt 2023-05-14 12:33:59 +08:00 committed by GitHub
parent 9a77eedd89
commit f2d78e87b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -33,6 +33,7 @@
#define AT_CMD_SEMICOLON ';' #define AT_CMD_SEMICOLON ';'
#define AT_CMD_CR '\r' #define AT_CMD_CR '\r'
#define AT_CMD_LF '\n' #define AT_CMD_LF '\n'
#define AT_CMD_NULL '\0'
static at_server_t at_server_local = RT_NULL; static at_server_t at_server_local = RT_NULL;
static at_cmd_t cmd_table = RT_NULL; static at_cmd_t cmd_table = RT_NULL;
@ -474,6 +475,10 @@ static void server_parser(at_server_t server)
continue; continue;
} }
else if (ch == AT_CMD_NULL)
{
continue;
}
else else
{ {
at_server_printf("%c", ch); at_server_printf("%c", ch);