Skip to content

Commit adceb3e

Browse files
committed
确保char line[]最后一位为'\0'
1 parent b809c02 commit adceb3e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

components/finsh/shell.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct finsh_shell
7878
struct finsh_parser parser;
7979
#endif
8080

81-
char line[FINSH_CMD_SIZE];
81+
char line[FINSH_CMD_SIZE + 1];
8282
rt_uint16_t line_position;
8383
rt_uint16_t line_curpos;
8484

@@ -107,4 +107,3 @@ const char *finsh_get_password(void);
107107
#endif
108108

109109
#endif
110-

0 commit comments

Comments
 (0)