diff options
| author | Meco Man <[email protected]> | 2021-12-30 19:38:20 -0500 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2022-01-09 00:23:18 +0800 |
| commit | f89a162ea3be6536c340c0010aab41cffe9bfac9 (patch) | |
| tree | 38c0c03a5c5ba348d9b657ad8e7ecb6f938ddf23 /components/dfs/src/dfs_file.c | |
| parent | bb1084556ff9395e6e5d908edfef9cab6f6fa4dc (diff) | |
[core] 使用rt_memcpy rt_memset代替memcpy memset
Diffstat (limited to 'components/dfs/src/dfs_file.c')
| -rw-r--r-- | components/dfs/src/dfs_file.c | 10 |
1 files changed, 5 insertions, 5 deletions
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); |
