diff options
author | araujo <araujo@FreeBSD.org> | 2016-04-18 05:26:32 +0000 |
---|---|---|
committer | araujo <araujo@FreeBSD.org> | 2016-04-18 05:26:32 +0000 |
commit | 0bd7ac2f20a043ce7a134de7a12c36437eb2c977 (patch) | |
tree | 3f324dea5ed04fb07c6e4a01e436b6766452552f | |
parent | 25333787db7b96c565f826f86cb864488835861f (diff) | |
download | FreeBSD-src-0bd7ac2f20a043ce7a134de7a12c36437eb2c977.zip FreeBSD-src-0bd7ac2f20a043ce7a134de7a12c36437eb2c977.tar.gz |
Use NULL instead of 0.
strtok(3) will return NULL when no more tokens remain.
MFC after: 2 weeks.
-rw-r--r-- | usr.bin/login/login_fbtab.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/login/login_fbtab.c b/usr.bin/login/login_fbtab.c index 8faee56..f4f0516 100644 --- a/usr.bin/login/login_fbtab.c +++ b/usr.bin/login/login_fbtab.c @@ -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; } |