Merge pull request #3960 from z14git/master

[shell] Ensure that the last char of `char line[]` is '\0'
This commit is contained in:
Bernard Xiong 2020-10-16 07:25:50 +08:00 committed by GitHub
commit 3ff0c07b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -78,7 +78,7 @@ struct finsh_shell
struct finsh_parser parser; struct finsh_parser parser;
#endif #endif
char line[FINSH_CMD_SIZE]; char line[FINSH_CMD_SIZE + 1];
rt_uint16_t line_position; rt_uint16_t line_position;
rt_uint16_t line_curpos; rt_uint16_t line_curpos;
@ -107,4 +107,3 @@ const char *finsh_get_password(void);
#endif #endif
#endif #endif