src/sbin/fsck_ext2fs/dir.c: In function 'dircheck':
src/sbin/fsck_ext2fs/dir.c:241: warning: comparison is always false due to 
limited range of data type

And indeed in /usr/include/ufs/ext2fs/ext2fs_dir.h e2d_namelen is
a u_int8_t and a few lines above #define EXT2FS_MAXNAMLEN        255

diff --git dir.c dir.c
index 9864bacd0d3..105f5153997 100644
--- dir.c
+++ dir.c
@@ -237,8 +237,7 @@ dircheck(struct inodesc *idesc, struct ext2fs_direct *dp)
                        return (1);
        size = EXT2FS_DIRSIZ(dp->e2d_namlen);
        if (reclen < size ||
-           idesc->id_filesize < size ||
-           dp->e2d_namlen > EXT2FS_MAXNAMLEN)
+           idesc->id_filesize < size)
                return (0);
        for (cp = dp->e2d_name, size = 0; size < dp->e2d_namlen; size++)
                if (*cp == '\0' || (*cp++ == '/'))

Reply via email to