summaryrefslogtreecommitdiff
path: root/components/dfs/filesystems
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2015-10-14 11:08:04 +0800
committerBernard Xiong <[email protected]>2015-10-14 11:08:04 +0800
commitc5fd1aaf5f89e6bcafc620c4dc7be5cb2f42d6d5 (patch)
treed7ff5e839d20383c53a804f13a4f8d2e7d58155f /components/dfs/filesystems
parent1086f6cfa03330a7afc87830e8e9a36a4db554a4 (diff)
parent6680a6b57ffada87ddd5756fb2228e6afc176a96 (diff)
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
Diffstat (limited to 'components/dfs/filesystems')
-rw-r--r--components/dfs/filesystems/romfs/dfs_romfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/dfs/filesystems/romfs/dfs_romfs.c b/components/dfs/filesystems/romfs/dfs_romfs.c
index 1dd41b41eb..6110d61227 100644
--- a/components/dfs/filesystems/romfs/dfs_romfs.c
+++ b/components/dfs/filesystems/romfs/dfs_romfs.c
@@ -96,7 +96,8 @@ struct romfs_dirent *dfs_romfs_lookup(struct romfs_dirent *root_dirent, const ch
{
if (check_dirent(&dirent[index]) != 0)
return RT_NULL;
- if (rt_strncmp(dirent[index].name, subpath, (subpath_end - subpath)) == 0)
+ if (rt_strlen(dirent[index].name) == (subpath_end - subpath) &&
+ rt_strncmp(dirent[index].name, subpath, (subpath_end - subpath)) == 0)
{
dirent_size = dirent[index].size;