1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-27 11:55:06 +00:00

Use NULL instead of 0.

strtok(3) will return NULL when no more tokens remain.

MFC after:	2 weeks.
This commit is contained in:
Marcelo Araujo 2016-04-18 05:26:32 +00:00
parent bb0bd931dc
commit 6a3f9a213a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298181

View File

@ -96,15 +96,15 @@ login_fbtab(char *tty, uid_t uid, gid_t gid)
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;
}