Date: Thu, 14 Apr 2016 12:51:06 +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: r297964 - head/usr.sbin/fstyp Message-ID: <201604141251.u3ECp6eN080719@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: araujo Date: Thu Apr 14 12:51:06 2016 New Revision: 297964 URL: https://svnweb.freebsd.org/changeset/base/297964 Log: Use NULL instead of 0 for pointers. The malloc will return a pointer to the allocated memory if successful, otherwise a NULL pointer is returned. Modified: head/usr.sbin/fstyp/fstyp.c Modified: head/usr.sbin/fstyp/fstyp.c ============================================================================== --- head/usr.sbin/fstyp/fstyp.c Thu Apr 14 12:50:27 2016 (r297963) +++ head/usr.sbin/fstyp/fstyp.c Thu Apr 14 12:51:06 2016 (r297964) @@ -82,7 +82,7 @@ read_buf(FILE *fp, off_t off, size_t len } buf = malloc(len); - if (buf == 0) { + if (buf == NULL) { warn("cannot malloc %zd bytes of memory", len); return (NULL); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604141251.u3ECp6eN080719>