svn commit: r297964 - head/usr.sbin/fstyp

Marcelo Araujo araujo at FreeBSD.org
Thu Apr 14 12:51:08 UTC 2016


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);
 	}


More information about the svn-src-head mailing list