Date: Mon, 18 Apr 2016 14:08:36 +0000 (UTC) From: Marcelo Araujo <araujo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298205 - in head/sbin: growfs newfs restore Message-ID: <201604181408.u3IE8aKe082032@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: araujo Date: Mon Apr 18 14:08:35 2016 New Revision: 298205 URL: https://svnweb.freebsd.org/changeset/base/298205 Log: Use NULL instead of 0 for pointers. strchr(3) will return NULL if the character does not appear in the string. MFC after: 2 weeks. Modified: head/sbin/growfs/growfs.c head/sbin/newfs/newfs.c head/sbin/restore/utilities.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Mon Apr 18 13:13:59 2016 (r298204) +++ head/sbin/growfs/growfs.c Mon Apr 18 14:08:35 2016 (r298205) @@ -1331,7 +1331,7 @@ getdev(const char *name) return (name); cp = strrchr(name, '/'); - if (cp == 0) { + if (cp == NULL) { snprintf(device, sizeof(device), "%s%s", _PATH_DEV, name); if (is_dev(device)) return (device); Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Mon Apr 18 13:13:59 2016 (r298204) +++ head/sbin/newfs/newfs.c Mon Apr 18 14:08:35 2016 (r298205) @@ -306,7 +306,7 @@ main(int argc, char *argv[]) if (!special[0]) err(1, "empty file/special name"); cp = strrchr(special, '/'); - if (cp == 0) { + if (cp == NULL) { /* * No path prefix; try prefixing _PATH_DEV. */ Modified: head/sbin/restore/utilities.c ============================================================================== --- head/sbin/restore/utilities.c Mon Apr 18 13:13:59 2016 (r298204) +++ head/sbin/restore/utilities.c Mon Apr 18 14:08:35 2016 (r298205) @@ -62,7 +62,7 @@ pathcheck(char *name) char *start; start = strchr(name, '/'); - if (start == 0) + if (start == NULL) return; for (cp = start; *cp != '\0'; cp++) { if (*cp != '/')
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604181408.u3IE8aKe082032>