Fix a bogus cast for a bogus pointer check. This only checks if the

pointer is 4-byte aligned. On a 64-bit machine it probably should
check that the pointer is 8-byte aligned (eh, Bruce?) 8-)
This commit is contained in:
John Birrell 1998-02-20 08:00:01 +00:00
parent 9fcbcd0217
commit 6abbaf17ac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=33665

View file

@ -60,7 +60,7 @@ readdir(dirp)
return (NULL);
}
dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
if ((int)dp & 03) /* bogus pointer check */
if ((long)dp & 03L) /* bogus pointer check */
return (NULL);
if (dp->d_reclen <= 0 ||
dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc)