Skip to content

Commit 131d50a

Browse files
xiaoxiang781216GUIDINGLI
authored andcommitted
nshlib: Remove the unnecessary temp path buffer
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1 parent 903fbe4 commit 131d50a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

nshlib/nsh_fscmds.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,6 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
21912191
bool recursive = false;
21922192
bool force = false;
21932193
FAR char *fullpath;
2194-
char buf[PATH_MAX];
21952194
struct stat stat;
21962195
int ret = ERROR;
21972196
int c;
@@ -2234,8 +2233,7 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
22342233
{
22352234
if (recursive)
22362235
{
2237-
strlcpy(buf, fullpath, PATH_MAX);
2238-
ret = unlink_recursive(buf, &stat);
2236+
ret = unlink_recursive(fullpath, &stat);
22392237
}
22402238
else
22412239
{

0 commit comments

Comments
 (0)