提交 ee5ce58b 编写于 作者: 福明 提交者: skylarCai

IssuID:1626:Comparing an array to null is not useful "dp->vfs_dirent.d_name !=...

IssuID:1626:Comparing an array to null is not useful "dp->vfs_dirent.d_name != NULL" since the test will always evaluate as true

[Detail]
Remove null check "dp->vfs_dirent.d_name != NULL" for "dp->vfs_dirent.d_name" is an array.

[Verified Cases]
Build Pass: <solution list>
Test Pass: <test case list>
上级 dcf78040
......@@ -330,13 +330,9 @@ static vfs_dirent_t *ramfs_vfs_readdir(vfs_file_t *fp, vfs_dir_t *dir)
int32_t res = -1;
dp = fp->f_arg;
if (dp->vfs_dirent.d_name != NULL) {
res = ramfs_readdir(&(dp->ramfs_dir), dp->vfs_dirent.d_name);
if (res == 0) {
ret = &dp->vfs_dirent;
}
res = ramfs_readdir(&(dp->ramfs_dir), dp->vfs_dirent.d_name);
if (res == 0) {
ret = &dp->vfs_dirent;
}
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册