summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-07-01 19:23:35 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-07-01 19:23:35 +0000
commit63313ee6c5a9165767398a3f0c4c4f7df084fe47 (patch)
treed5d99aac530d3e75b12a2ff76801826dd953628d
parent5456f916570496d9567b402365284220a35044e8 (diff)
simpilfy warning() and wall
-rw-r--r--usr.bin/gencat/gencat.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/gencat/gencat.c b/usr.bin/gencat/gencat.c
index 023ae413c74..3e7851b2506 100644
--- a/usr.bin/gencat/gencat.c
+++ b/usr.bin/gencat/gencat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gencat.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $ */
+/* $OpenBSD: gencat.c,v 1.9 2004/07/01 19:23:34 mickey Exp $ */
/* $NetBSD: gencat.c,v 1.9 1998/10/09 17:00:56 itohy Exp $ */
/*-
@@ -39,8 +39,8 @@
#include <sys/cdefs.h>
#ifndef lint
-static char rcsid[] =
- "$OpenBSD: gencat.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $";
+static const char rcsid[] =
+ "$OpenBSD: gencat.c,v 1.9 2004/07/01 19:23:34 mickey Exp $";
#endif /* not lint */
/***********************************************************
@@ -90,6 +90,9 @@ up-to-date. Many thanks.
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <fcntl.h>
+#include <nl_types.h>
+#include <err.h>
struct _msgT {
long msgId;
@@ -179,8 +182,7 @@ main(int argc, char *argv[])
static void
warning(char *cptr, char *msg)
{
- fprintf(stderr, "%s: %s on line %ld\n", __progname, msg, lineno);
- fprintf(stderr, "%s\n", curline);
+ warnx("%s on line %ld\n%s", msg, lineno, curline);
if (cptr) {
char *tptr;
for (tptr = curline; tptr < cptr; ++tptr)