summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorz14git <[email protected]>2020-10-14 09:27:40 +0800
committerz14git <[email protected]>2020-10-14 09:27:40 +0800
commitadceb3e2a4a6535fa742a356f810bf1f445fe672 (patch)
tree035cce9e920629ea27ef308dee90d3d3054c8349 /components
parentb809c020150a371824481f7f4bb3b5608ff1f85e (diff)
确保char line[]最后一位为'\0'
Diffstat (limited to 'components')
-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
-