From 0bd7ac2f20a043ce7a134de7a12c36437eb2c977 Mon Sep 17 00:00:00 2001 From: araujo Date: Mon, 18 Apr 2016 05:26:32 +0000 Subject: [PATCH] Use NULL instead of 0. strtok(3) will return NULL when no more tokens remain. MFC after: 2 weeks. --- usr.bin/login/login_fbtab.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/login/login_fbtab.c b/usr.bin/login/login_fbtab.c index 8faee56b71c9..f4f0516a5a3c 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; }