summaryrefslogtreecommitdiff
path: root/usr.bin/checknr
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-07-01 19:20:24 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-07-01 19:20:24 +0000
commit5456f916570496d9567b402365284220a35044e8 (patch)
tree8415243b9f73a71cb497b76f9e39772d4924afb1 /usr.bin/checknr
parent9623c153ae5288298ce339ed7bfc4b9426bb4c8c (diff)
warn vs perror; __progname; and wall
Diffstat (limited to 'usr.bin/checknr')
-rw-r--r--usr.bin/checknr/checknr.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/checknr/checknr.c b/usr.bin/checknr/checknr.c
index d42ef90f041..f8edbb92ba5 100644
--- a/usr.bin/checknr/checknr.c
+++ b/usr.bin/checknr/checknr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: checknr.c,v 1.11 2003/06/25 21:09:09 deraadt Exp $ */
+/* $OpenBSD: checknr.c,v 1.12 2004/07/01 19:20:23 mickey Exp $ */
/* $NetBSD: checknr.c,v 1.4 1995/03/26 04:10:19 glass Exp $ */
/*
@@ -31,16 +31,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)checknr.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)checknr.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: checknr.c,v 1.11 2003/06/25 21:09:09 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: checknr.c,v 1.12 2004/07/01 19:20:23 mickey Exp $";
#endif
#endif /* not lint */
@@ -56,6 +56,7 @@ static char rcsid[] = "$OpenBSD: checknr.c,v 1.11 2003/06/25 21:09:09 deraadt Ex
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
+#include <err.h>
#define MAXSTK 100 /* Stack size */
#define MAXBR 100 /* Max number of bracket pairs known */
@@ -258,7 +259,7 @@ main(int argc, char *argv[])
cfilename = argv[i];
f = fopen(cfilename, "r");
if (f == NULL)
- perror(cfilename);
+ warn(cfilename);
else
process(f);
}
@@ -272,9 +273,10 @@ main(int argc, char *argv[])
void
usage(void)
{
+ extern char *__progname;
(void)fprintf(stderr,
- "usage: checknr [-fs] [-a.x1.y1.x2.y2. ... .xn.yn] "
- "[-c.x1.x2.x3. ... .xn] [file]\n");
+ "usage: %s [-fs] [-a.x1.y1.x2.y2. ... .xn.yn] "
+ "[-c.x1.x2.x3. ... .xn] [file]\n", __progname);
exit(1);
}