This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 8d7497f7f memdump:fix bug with space does not parse correctly
8d7497f7f is described below
commit 8d7497f7fb36779456de10bf6c8e25f99e69d6d6
Author: anjiahao <[email protected]>
AuthorDate: Tue Aug 29 16:44:55 2023 +0800
memdump:fix bug with space does not parse correctly
Signed-off-by: anjiahao <[email protected]>
---
nshlib/nsh_mmcmds.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/nshlib/nsh_mmcmds.c b/nshlib/nsh_mmcmds.c
index 0b25becb0..770a3b889 100644
--- a/nshlib/nsh_mmcmds.c
+++ b/nshlib/nsh_mmcmds.c
@@ -68,7 +68,10 @@ int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR
char **argv)
for (i = 1; i < argc; i++)
{
strlcat(arg, argv[i], CONFIG_NSH_LINELEN);
- strlcat(arg, " ", CONFIG_NSH_LINELEN);
+ if (i < argc - 1)
+ {
+ strlcat(arg, " ", CONFIG_NSH_LINELEN);
+ }
}
}