Browse Source

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

fix issue #7005
wenxingpt 2 years ago
parent
commit
f2d78e87b5
1 changed files with 5 additions and 0 deletions
  1. 5 0
      components/net/at/src/at_server.c

+ 5 - 0
components/net/at/src/at_server.c

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