svn commit: r298207 - head/lib/libcompat/4.3

Pedro F. Giffuni pfg at FreeBSD.org
Mon Apr 18 14:37:28 UTC 2016


Author: pfg
Date: Mon Apr 18 14:37:26 2016
New Revision: 298207
URL: https://svnweb.freebsd.org/changeset/base/298207

Log:
  rexec(3): use NULL instead of zero for pointers.

Modified:
  head/lib/libcompat/4.3/rexec.c

Modified: head/lib/libcompat/4.3/rexec.c
==============================================================================
--- head/lib/libcompat/4.3/rexec.c	Mon Apr 18 14:12:42 2016	(r298206)
+++ head/lib/libcompat/4.3/rexec.c	Mon Apr 18 14:37:26 2016	(r298207)
@@ -187,7 +187,7 @@ next:
 
 		case LOGIN:
 			if (token())
-				if (*aname == 0) {
+				if (*aname == NULL) {
 					*aname = malloc((unsigned) strlen(tokval) + 1);
 					(void) strcpy(*aname, tokval);
 				} else {
@@ -196,14 +196,14 @@ next:
 				}
 			break;
 		case PASSWD:
-			if ((*aname == 0 || strcmp(*aname, "anonymous")) &&
+			if ((*aname == NULL || strcmp(*aname, "anonymous")) &&
 			    fstat(fileno(cfile), &stb) >= 0 &&
 			    (stb.st_mode & 077) != 0) {
 	warnx("Error: .netrc file is readable by others.");
 	warnx("Remove password or make file unreadable by others.");
 				goto bad;
 			}
-			if (token() && *apass == 0) {
+			if (token() && *apass == NULL) {
 				*apass = malloc((unsigned) strlen(tokval) + 1);
 				(void) strcpy(*apass, tokval);
 			}
@@ -215,7 +215,7 @@ next:
 	warnx("Remove account or make file unreadable by others.");
 				goto bad;
 			}
-			if (token() && *aacct == 0) {
+			if (token() && *aacct == NULL) {
 				*aacct = malloc((unsigned) strlen(tokval) + 1);
 				(void) strcpy(*aacct, tokval);
 			}
@@ -305,7 +305,7 @@ rexec(ahost, rport, name, pass, cmd, fd2
 	char c, *acct;
 
 	hp = gethostbyname(*ahost);
-	if (hp == 0) {
+	if (hp == NULL) {
 		herror(*ahost);
 		return (-1);
 	}


More information about the svn-src-head mailing list