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:
parent
fb6a35935a
commit
cd5f6a0cc1
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue