svn commit: r211132 - head/usr.bin/indent

Kevin Lo kevlo at FreeBSD.org
Tue Aug 10 06:58:13 UTC 2010


Author: kevlo
Date: Tue Aug 10 06:58:12 2010
New Revision: 211132
URL: http://svn.freebsd.org/changeset/base/211132

Log:
  Use NULL instead of 0 when setting up pointer.

Modified:
  head/usr.bin/indent/indent.c

Modified: head/usr.bin/indent/indent.c
==============================================================================
--- head/usr.bin/indent/indent.c	Tue Aug 10 06:25:08 2010	(r211131)
+++ head/usr.bin/indent/indent.c	Tue Aug 10 06:58:12 2010	(r211132)
@@ -199,21 +199,21 @@ main(int argc, char **argv)
 	 * look thru args (if any) for changes to defaults
 	 */
 	if (argv[i][0] != '-') {/* no flag on parameter */
-	    if (input == 0) {	/* we must have the input file */
+	    if (input == NULL) {	/* we must have the input file */
 		in_name = argv[i];	/* remember name of input file */
 		input = fopen(in_name, "r");
-		if (input == 0)		/* check for open error */
+		if (input == NULL)	/* check for open error */
 			err(1, "%s", in_name);
 		continue;
 	    }
-	    else if (output == 0) {	/* we have the output file */
+	    else if (output == NULL) {	/* we have the output file */
 		out_name = argv[i];	/* remember name of output file */
 		if (strcmp(in_name, out_name) == 0) {	/* attempt to overwrite
 							 * the file */
 		    errx(1, "input and output files must be different");
 		}
 		output = fopen(out_name, "w");
-		if (output == 0)	/* check for create error */
+		if (output == NULL)	/* check for create error */
 			err(1, "%s", out_name);
 		continue;
 	    }
@@ -222,9 +222,9 @@ main(int argc, char **argv)
 	else
 	    set_option(argv[i]);
     }				/* end of for */
-    if (input == 0)
+    if (input == NULL)
 	input = stdin;
-    if (output == 0) {
+    if (output == NULL) {
 	if (troff || input == stdin)
 	    output = stdout;
 	else {
@@ -1223,11 +1223,11 @@ bakcopy(void)
 
     /* re-open backup file as the input file */
     input = fopen(bakfile, "r");
-    if (input == 0)
+    if (input == NULL)
 	err(1, "%s", bakfile);
     /* now the original input file will be the output */
     output = fopen(in_name, "w");
-    if (output == 0) {
+    if (output == NULL) {
 	unlink(bakfile);
 	err(1, "%s", in_name);
     }


More information about the svn-src-all mailing list