svn commit: r298181 - head/usr.bin/login

Marcelo Araujo araujo at FreeBSD.org
Mon Apr 18 05:26:34 UTC 2016


Author: araujo
Date: Mon Apr 18 05:26:32 2016
New Revision: 298181
URL: https://svnweb.freebsd.org/changeset/base/298181

Log:
  Use NULL instead of 0.
  
  strtok(3) will return NULL when no more tokens remain.
  
  MFC after:	2 weeks.

Modified:
  head/usr.bin/login/login_fbtab.c

Modified: head/usr.bin/login/login_fbtab.c
==============================================================================
--- head/usr.bin/login/login_fbtab.c	Mon Apr 18 05:19:45 2016	(r298180)
+++ head/usr.bin/login/login_fbtab.c	Mon Apr 18 05:26:32 2016	(r298181)
@@ -96,15 +96,15 @@ login_fbtab(char *tty, uid_t uid, gid_t 
     while (fgets(buf, sizeof(buf), fp)) {
 	if ((cp = strchr(buf, '#')))
 	    *cp = 0;				/* strip comment */
-	if ((cp = devname = strtok(buf, WSPACE)) == 0)
+	if ((cp = devname = strtok(buf, WSPACE)) == NULL)
 	    continue;				/* empty or comment */
 	if (strncmp(devname, _PATH_DEV, sizeof _PATH_DEV - 1) != 0
-	       || (cp = strtok(NULL, WSPACE)) == 0
+	       || (cp = strtok(NULL, WSPACE)) == NULL
 	       || *cp != '0'
 	       || sscanf(cp, "%o", &prot) == 0
 	       || prot == 0
 	       || (prot & 0777) != prot
-	       || (cp = strtok(NULL, WSPACE)) == 0) {
+	       || (cp = strtok(NULL, WSPACE)) == NULL) {
 	    syslog(LOG_ERR, "%s: bad entry: %s", table, cp ? cp : "(null)");
 	    continue;
 	}


More information about the svn-src-head mailing list