This is an automated email from the ASF dual-hosted git repository.

ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 131d50ae9d76e479d89886d1136585ffb365cde3
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Sun Jan 19 09:58:40 2025 +0800

    nshlib: Remove the unnecessary temp path buffer
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 nshlib/nsh_fscmds.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c
index 60b88e6dd..3eb41c377 100644
--- a/nshlib/nsh_fscmds.c
+++ b/nshlib/nsh_fscmds.c
@@ -2191,7 +2191,6 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, FAR 
char **argv)
   bool recursive = false;
   bool force = false;
   FAR char *fullpath;
-  char buf[PATH_MAX];
   struct stat stat;
   int ret = ERROR;
   int c;
@@ -2234,8 +2233,7 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, FAR 
char **argv)
     {
       if (recursive)
         {
-          strlcpy(buf, fullpath, PATH_MAX);
-          ret = unlink_recursive(buf, &stat);
+          ret = unlink_recursive(fullpath, &stat);
         }
       else
         {

Reply via email to