svn commit: r298194 - head/sbin/fsck

Marcelo Araujo araujo at FreeBSD.org
Mon Apr 18 07:44:54 UTC 2016


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;


More information about the svn-src-head mailing list