summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2020-10-16 07:25:50 +0800
committerGitHub <[email protected]>2020-10-16 07:25:50 +0800
commit3ff0c07b3823c1ae7381eed29a0591eda43eb844 (patch)
tree5b20a21f291b6de0e1bbba67c72eb63060ed093d
parent8fc2f6e7f10c80939f5d5cbbfadfd7612d21da1c (diff)
parentadceb3e2a4a6535fa742a356f810bf1f445fe672 (diff)
Merge pull request #3960 from z14git/master
[shell] Ensure that the last char of `char line[]` is '\0'
-rw-r--r--components/finsh/shell.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/finsh/shell.h b/components/finsh/shell.h
index 8741759ed4..8f94e23e8b 100644
--- a/components/finsh/shell.h
+++ b/components/finsh/shell.h
@@ -78,7 +78,7 @@ struct finsh_shell
struct finsh_parser parser;
#endif
- char line[FINSH_CMD_SIZE];
+ char line[FINSH_CMD_SIZE + 1];
rt_uint16_t line_position;
rt_uint16_t line_curpos;
@@ -107,4 +107,3 @@ const char *finsh_get_password(void);
#endif
#endif
-