svn commit: r298210 - head/lib/libstand

Pedro F. Giffuni pfg at FreeBSD.org
Mon Apr 18 14:45:58 UTC 2016


Author: pfg
Date: Mon Apr 18 14:45:56 2016
New Revision: 298210
URL: https://svnweb.freebsd.org/changeset/base/298210

Log:
  libstand: use NULL instead of zero for pointers.

Modified:
  head/lib/libstand/cd9660.c
  head/lib/libstand/nfs.c
  head/lib/libstand/strtol.c

Modified: head/lib/libstand/cd9660.c
==============================================================================
--- head/lib/libstand/cd9660.c	Mon Apr 18 14:44:01 2016	(r298209)
+++ head/lib/libstand/cd9660.c	Mon Apr 18 14:45:56 2016	(r298210)
@@ -273,13 +273,13 @@ dirmatch(struct open_file *f, const char
 static int
 cd9660_open(const char *path, struct open_file *f)
 {
-	struct file *fp = 0;
+	struct file *fp = NULL;
 	void *buf;
 	struct iso_primary_descriptor *vd;
 	size_t buf_size, read, dsize, off;
 	daddr_t bno, boff;
 	struct iso_directory_record rec;
-	struct iso_directory_record *dp = 0;
+	struct iso_directory_record *dp = NULL;
 	int rc, first, use_rrip, lenskip;
 
 	/* First find the volume descriptor */
@@ -415,7 +415,7 @@ cd9660_close(struct open_file *f)
 {
 	struct file *fp = (struct file *)f->f_fsdata;
 
-	f->f_fsdata = 0;
+	f->f_fsdata = NULL;
 	free(fp);
 
 	return 0;

Modified: head/lib/libstand/nfs.c
==============================================================================
--- head/lib/libstand/nfs.c	Mon Apr 18 14:44:01 2016	(r298209)
+++ head/lib/libstand/nfs.c	Mon Apr 18 14:45:56 2016	(r298210)
@@ -511,7 +511,7 @@ nfs_open(const char *upath, struct open_
 
 #ifndef NFS_NOSYMLINK
 	bcopy(&nfs_root_node, currfd, sizeof(*currfd));
-	newfd = 0;
+	newfd = NULL;
 
 	cp = path = strdup(upath);
 	if (path == NULL) {
@@ -593,14 +593,14 @@ nfs_open(const char *upath, struct open_
 				bcopy(&nfs_root_node, currfd, sizeof(*currfd));
 
 			free(newfd);
-			newfd = 0;
+			newfd = NULL;
 
 			continue;
 		}
 
 		free(currfd);
 		currfd = newfd;
-		newfd = 0;
+		newfd = NULL;
 	}
 
 	error = 0;
@@ -1155,7 +1155,7 @@ nfs_open(const char *upath, struct open_
 	}
 #ifndef NFS_NOSYMLINK
 	bcopy(&nfs_root_node, currfd, sizeof(*currfd));
-	newfd = 0;
+	newfd = NULL;
 
 	cp = path = strdup(upath);
 	if (path == NULL) {
@@ -1241,14 +1241,14 @@ nfs_open(const char *upath, struct open_
 				bcopy(&nfs_root_node, currfd, sizeof(*currfd));
 
 			free(newfd);
-			newfd = 0;
+			newfd = NULL;
 
 			continue;
 		}
 
 		free(currfd);
 		currfd = newfd;
-		newfd = 0;
+		newfd = NULL;
 	}
 
 	error = 0;

Modified: head/lib/libstand/strtol.c
==============================================================================
--- head/lib/libstand/strtol.c	Mon Apr 18 14:44:01 2016	(r298209)
+++ head/lib/libstand/strtol.c	Mon Apr 18 14:45:56 2016	(r298210)
@@ -126,7 +126,7 @@ strtol(nptr, endptr, base)
 		errno = ERANGE;
 	} else if (neg)
 		acc = -acc;
-	if (endptr != 0)
+	if (endptr != NULL)
 		*endptr = (char *)(any ? s - 1 : nptr);
 	return (acc);
 }


More information about the svn-src-head mailing list