From 048481b9dc03d74ad8acf4c952c3883e2c1cacdf Mon Sep 17 00:00:00 2001 From: araujo Date: Mon, 18 Apr 2016 07:44:53 +0000 Subject: 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. --- sbin/fsck/fsck.c | 2 +- sbin/fsck/preen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sbin') diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c index 63ff153..bf1892c 100644 --- a/sbin/fsck/fsck.c +++ b/sbin/fsck/fsck.c @@ -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; diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c index 18f2801..d367eb2 100644 --- a/sbin/fsck/preen.c +++ b/sbin/fsck/preen.c @@ -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; -- cgit v1.1