summaryrefslogtreecommitdiffstats
path: root/usr.bin/colrm
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-06-26 11:26:20 +0000
committercharnier <charnier@FreeBSD.org>1997-06-26 11:26:20 +0000
commit58f4514cd9e7669e242b1a2ad4a3b46e7d720071 (patch)
treed7172bd65eb1ebb9b4485747925412fa52428d22 /usr.bin/colrm
parentd9b3513e3c222244ce0321df7ec93793f28f2d38 (diff)
downloadFreeBSD-src-58f4514cd9e7669e242b1a2ad4a3b46e7d720071.zip
FreeBSD-src-58f4514cd9e7669e242b1a2ad4a3b46e7d720071.tar.gz
Use err(3) instead of local redefinition.
Diffstat (limited to 'usr.bin/colrm')
-rw-r--r--usr.bin/colrm/colrm.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c
index 541fd9c..977d2ec 100644
--- a/usr.bin/colrm/colrm.c
+++ b/usr.bin/colrm/colrm.c
@@ -29,6 +29,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $Id$
*/
#ifndef lint
@@ -43,6 +45,7 @@ static char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95";
#include <sys/types.h>
#include <limits.h>
+#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -51,9 +54,8 @@ static char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95";
#define TAB 8
-void err __P((const char *, ...));
void check __P((FILE *));
-void usage __P((void));
+static void usage __P((void));
int
main(argc, argv)
@@ -78,12 +80,12 @@ main(argc, argv)
case 2:
stop = strtol(argv[1], &p, 10);
if (stop <= 0 || *p)
- err("illegal column -- %s", argv[1]);
+ errx(1, "illegal column -- %s", argv[1]);
/* FALLTHROUGH */
case 1:
start = strtol(argv[0], &p, 10);
if (start <= 0 || *p)
- err("illegal column -- %s", argv[0]);
+ errx(1, "illegal column -- %s", argv[0]);
break;
case 0:
break;
@@ -92,7 +94,7 @@ main(argc, argv)
}
if (stop && start > stop)
- err("illegal start and stop columns");
+ errx(1, "illegal start and stop columns");
for (column = 0;;) {
switch (ch = getchar()) {
@@ -127,8 +129,7 @@ check(stream)
if (feof(stream))
exit(0);
if (ferror(stream))
- err("%s: %s",
- stream == stdin ? "stdin" : "stdout", strerror(errno));
+ err(1, "%s", stream == stdin ? "stdin" : "stdout");
}
void
@@ -138,6 +139,7 @@ usage()
exit(1);
}
+#ifdef 0
#if __STDC__
#include <stdarg.h>
#else
@@ -166,3 +168,4 @@ err(fmt, va_alist)
exit(1);
/* NOTREACHED */
}
+#endif
OpenPOWER on IntegriCloud