From owner-svn-src-all@FreeBSD.ORG Tue Aug 10 06:58:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2425A1065675; Tue, 10 Aug 2010 06:58:13 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB998FC12; Tue, 10 Aug 2010 06:58:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7A6wCHu040966; Tue, 10 Aug 2010 06:58:12 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7A6wCJV040964; Tue, 10 Aug 2010 06:58:12 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201008100658.o7A6wCJV040964@svn.freebsd.org> From: Kevin Lo Date: Tue, 10 Aug 2010 06:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211132 - head/usr.bin/indent X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2010 06:58:13 -0000 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); }