From owner-svn-src-head@freebsd.org Thu Apr 14 12:46:47 2016 Return-Path: Delivered-To: svn-src-head@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 9FD7FB0E32A; Thu, 14 Apr 2016 12:46:47 +0000 (UTC) (envelope-from araujo@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 70B451D5F; Thu, 14 Apr 2016 12:46:47 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3ECkk57080480; Thu, 14 Apr 2016 12:46:46 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3ECkk0g080478; Thu, 14 Apr 2016 12:46:46 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604141246.u3ECkk0g080478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 14 Apr 2016 12:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297962 - head/usr.sbin/fdread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2016 12:46:47 -0000 Author: araujo Date: Thu Apr 14 12:46:46 2016 New Revision: 297962 URL: https://svnweb.freebsd.org/changeset/base/297962 Log: Use NULL instead of 0 for pointers. The strchr(3) returns a NULL if the character does not appears in the string. The malloc will return NULL if cannot allocate memory. Modified: head/usr.sbin/fdread/fdread.c head/usr.sbin/fdread/fdutil.c Modified: head/usr.sbin/fdread/fdread.c ============================================================================== --- head/usr.sbin/fdread/fdread.c Thu Apr 14 12:25:00 2016 (r297961) +++ head/usr.sbin/fdread/fdread.c Thu Apr 14 12:46:46 2016 (r297962) @@ -170,7 +170,7 @@ doread(int fd, FILE *of, const char *_de secsize = 128 << fdt.secsize; tracksize = fdt.sectrac * secsize; mediasize = tracksize * fdt.tracks * fdt.heads; - if ((trackbuf = malloc(tracksize)) == 0) + if ((trackbuf = malloc(tracksize)) == NULL) errx(EX_TEMPFAIL, "out of memory"); if (!quiet) Modified: head/usr.sbin/fdread/fdutil.c ============================================================================== --- head/usr.sbin/fdread/fdutil.c Thu Apr 14 12:25:00 2016 (r297961) +++ head/usr.sbin/fdread/fdutil.c Thu Apr 14 12:46:46 2016 (r297962) @@ -200,10 +200,10 @@ parse_fmt(const char *s, enum fd_drivety *out = in; for (i = 0;; i++) { - if (s == 0) + if (s == NULL) break; - if ((cp = strchr(s, ',')) == 0) { + if ((cp = strchr(s, ',')) == NULL) { s1 = strdup(s); if (s1 == NULL) abort();