fix:修复函数返回错误等问题

Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
This commit is contained in:
zhangdengyu
2022-09-24 17:04:38 +08:00
parent 453c376198
commit 043e84dfcb
34 changed files with 82 additions and 79 deletions

View File

@@ -761,11 +761,6 @@ static int os_shell_cmd_do_rmdir(const char *pathname)
}
if (strcmp(dirent->d_name, "..") && strcmp(dirent->d_name, ".")) {
size_t fullpath_buf_size = strlen(pathname) + strlen(dirent->d_name) + SEPARATOR_EOF_LEN;
if (fullpath_buf_size <= 0) {
PRINTK("buffer size is invalid!\n");
(void)closedir(d);
return -1;
}
fullpath = (char *)malloc(fullpath_buf_size);
if (fullpath == NULL) {
PRINTK("malloc failure!\n");