summaryrefslogtreecommitdiffstats
path: root/usr.bin/indent
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2010-08-10 06:58:12 +0000
committerkevlo <kevlo@FreeBSD.org>2010-08-10 06:58:12 +0000
commita61fa6e933b83fcfbac9e8b0405c1fd93b9d4169 (patch)
tree2b8e27cb10ebced176694a5dc3bbd1b7a906ca41 /usr.bin/indent
parent781d513f0b768f89b98bbff174dff6687a16550c (diff)
downloadFreeBSD-src-a61fa6e933b83fcfbac9e8b0405c1fd93b9d4169.zip
FreeBSD-src-a61fa6e933b83fcfbac9e8b0405c1fd93b9d4169.tar.gz
Use NULL instead of 0 when setting up pointer.
Diffstat (limited to 'usr.bin/indent')
-rw-r--r--usr.bin/indent/indent.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index 7820ebe..161a758 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -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);
}
OpenPOWER on IntegriCloud