From owner-svn-src-all@freebsd.org Tue Apr 19 19:13:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B277CB14638; Tue, 19 Apr 2016 19:13:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BAAD139A; Tue, 19 Apr 2016 19:13:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3JJDXRF015176; Tue, 19 Apr 2016 19:13:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3JJDXZL015174; Tue, 19 Apr 2016 19:13:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604191913.u3JJDXZL015174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Apr 2016 19:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298288 - head/sbin/dump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:13:34 -0000 Author: pfg Date: Tue Apr 19 19:13:33 2016 New Revision: 298288 URL: https://svnweb.freebsd.org/changeset/base/298288 Log: dump: use NULL instead of zero for pointers. Clean out the casts from calloc(3) while here. Modified: head/sbin/dump/itime.c head/sbin/dump/main.c Modified: head/sbin/dump/itime.c ============================================================================== --- head/sbin/dump/itime.c Tue Apr 19 19:08:44 2016 (r298287) +++ head/sbin/dump/itime.c Tue Apr 19 19:13:33 2016 (r298288) @@ -58,7 +58,7 @@ struct dumptime { SLIST_ENTRY(dumptime) dt_list; }; SLIST_HEAD(dthead, dumptime) dthead = SLIST_HEAD_INITIALIZER(dthead); -struct dumpdates **ddatev = 0; +struct dumpdates **ddatev = NULL; int nddates = 0; static void dumprecout(FILE *, const struct dumpdates *); @@ -118,8 +118,7 @@ readdumptimes(FILE *df) * arrayify the list, leaving enough room for the additional * record that we may have to add to the ddate structure */ - ddatev = (struct dumpdates **) - calloc((unsigned) (nddates + 1), sizeof (struct dumpdates *)); + ddatev = calloc((unsigned) (nddates + 1), sizeof (struct dumpdates *)); dtwalk = SLIST_FIRST(&dthead); for (i = nddates - 1; i >= 0; i--, dtwalk = SLIST_NEXT(dtwalk, dt_list)) ddatev[i] = &dtwalk->dt_value; @@ -174,8 +173,8 @@ putdumptime(void) fd = fileno(df); (void) flock(fd, LOCK_EX); fname = disk; - free((char *)ddatev); - ddatev = 0; + free(ddatev); + ddatev = NULL; nddates = 0; readdumptimes(df); if (fseek(df, 0L, 0) < 0) Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Tue Apr 19 19:08:44 2016 (r298287) +++ head/sbin/dump/main.c Tue Apr 19 19:13:33 2016 (r298288) @@ -340,7 +340,7 @@ main(int argc, char *argv[]) spcl.c_dev[NAMELEN-1]='\0'; spcl.c_filesys[NAMELEN-1]='\0'; - if ((mntpt = getmntpt(disk, &mntflags)) != 0) { + if ((mntpt = getmntpt(disk, &mntflags)) != NULL) { if (mntflags & MNT_RDONLY) { if (snapdump != 0) { msg("WARNING: %s\n",