From f89a162ea3be6536c340c0010aab41cffe9bfac9 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 30 Dec 2021 19:38:20 -0500 Subject: [core] 使用rt_memcpy rt_memset代替memcpy memset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/src/dfs_file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'components/dfs/src/dfs_file.c') diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index 711a461e20..a798bd3c59 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -543,11 +543,11 @@ void ls(const char *pathname) rt_kprintf("Directory %s:\n", path); do { - memset(&dirent, 0, sizeof(struct dirent)); + rt_memset(&dirent, 0, sizeof(struct dirent)); length = dfs_file_getdents(&fd, &dirent, sizeof(struct dirent)); if (length > 0) { - memset(&stat, 0, sizeof(struct stat)); + rt_memset(&stat, 0, sizeof(struct stat)); /* build full path for each file */ fullpath = dfs_normalize_path(path, dirent.d_name); @@ -607,7 +607,7 @@ void cat(const char *filename) do { - memset(buffer, 0, sizeof(buffer)); + rt_memset(buffer, 0, sizeof(buffer)); length = dfs_file_read(&fd, buffer, sizeof(buffer) - 1); if (length > 0) { @@ -692,7 +692,7 @@ static void copydir(const char *src, const char *dst) do { - memset(&dirent, 0, sizeof(struct dirent)); + rt_memset(&dirent, 0, sizeof(struct dirent)); length = dfs_file_getdents(&cpfd, &dirent, sizeof(struct dirent)); if (length > 0) @@ -716,7 +716,7 @@ static void copydir(const char *src, const char *dst) break; } - memset(&stat, 0, sizeof(struct stat)); + rt_memset(&stat, 0, sizeof(struct stat)); if (dfs_file_stat(src_entry_full, &stat) != 0) { rt_kprintf("open file: %s failed\n", dirent.d_name); -- cgit v1.3.1