Date: Mon, 18 Apr 2016 07:44:53 +0000 (UTC) From: Marcelo Araujo <araujo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298194 - head/sbin/fsck Message-ID: <201604180744.u3I7irai064390@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: araujo Date: Mon Apr 18 07:44:53 2016 New Revision: 298194 URL: https://svnweb.freebsd.org/changeset/base/298194 Log: 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. Modified: head/sbin/fsck/fsck.c head/sbin/fsck/preen.c Modified: head/sbin/fsck/fsck.c ============================================================================== --- head/sbin/fsck/fsck.c Mon Apr 18 07:40:36 2016 (r298193) +++ head/sbin/fsck/fsck.c Mon Apr 18 07:44:53 2016 (r298194) @@ -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; Modified: head/sbin/fsck/preen.c ============================================================================== --- head/sbin/fsck/preen.c Mon Apr 18 07:40:36 2016 (r298193) +++ head/sbin/fsck/preen.c Mon Apr 18 07:44:53 2016 (r298194) @@ -106,7 +106,7 @@ checkfstab(int flags, int (*docheck)(str 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604180744.u3I7irai064390>