Open
Description
The function uses lfs_bd_cmp()
which, from what I understand, compares data on disk with an arbitrary data passed as argument, and returns:
LFS_CMP_LT
- the data on disk is less than the arbitrary dataLFS_CMP_GT
- the data on disk is greater than the arbitrary dataLFS_CMP_EQ
- the data on disk and the arbitrary data are equal
If the function returns LFS_CMP_EQ
, we perform an additional comparison:
if (name->size != lfs_tag_size(tag)) {
return (name->size < lfs_tag_size(tag)) ? LFS_CMP_LT : LFS_CMP_GT;
}
This comparison looks suspicious because it returns LFS_CMP_LT
is the arbitrary data (not the data on disk) is shorter than the data on disk. Maybe it was intended this way but just in case decided to report.