strchr(3) will return NULL if it cannot find the character in the

string.
getfsent(3) will return NULL on EOF or error.

MFC after:	2 weeks.
This commit is contained in:
Marcelo Araujo 2016-04-18 07:44:53 +00:00
parent fb6a35935a
commit cd5f6a0cc1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298194
2 changed files with 2 additions and 2 deletions

View File

@ -200,7 +200,7 @@ main(int argc, char *argv[])
mntpt = NULL;
spec = *argv;
cp = strrchr(spec, '/');
if (cp == 0) {
if (cp == NULL) {
(void)snprintf(device, sizeof(device), "%s%s",
_PATH_DEV, spec);
spec = device;

View File

@ -106,7 +106,7 @@ checkfstab(int flags, int (*docheck)(struct fstab *),
warnx("Can't open checklist file: %s\n", _PATH_FSTAB);
return (8);
}
while ((fs = getfsent()) != 0) {
while ((fs = getfsent()) != NULL) {
name = fs->fs_spec;
if (fs->fs_passno > passno && fs->fs_passno < nextpass)
nextpass = fs->fs_passno;