mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
fix readdir issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@147 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
1 parent
6c27bf33ff
commit
fee61e2c2a
2 files changed
+74
-70
No files matched your search
@@ -302,9 +302,9 @@ int dfs_elm_getdents(struct dfs_fd* file, struct dfs_dirent* dirp, rt_uint32_t c
|
||||
if (fno.fattrib & AM_DIR) d->d_type &= DFS_DT_DIR;
|
||||
else d->d_type &= DFS_DT_REG;
|
||||
|
||||
d->d_namlen = rt_strlen(fn) - 1;
|
||||
d->d_namlen = rt_strlen(fn);
|
||||
d->d_reclen = (rt_uint16_t)sizeof(struct dfs_dirent);
|
||||
rt_strncpy(d->d_name, fn, rt_strlen(fn));
|
||||
rt_strncpy(d->d_name, fn, rt_strlen(fn) + 1);
|
||||
|
||||
index ++;
|
||||
if ( index * sizeof(struct dfs_dirent) >= count )
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user