summaryrefslogtreecommitdiffstats
path: root/usr.bin/expand/expand.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2000-03-26 14:28:31 +0000
committercharnier <charnier@FreeBSD.org>2000-03-26 14:28:31 +0000
commit26ea86f226645220e1d19a2188b311adfcba314a (patch)
treea00ceee7dc559295ecc34ffffed9279be5e7e4f2 /usr.bin/expand/expand.c
parent9349f009d7736cba72463c747e2c51160db813d6 (diff)
downloadFreeBSD-src-26ea86f226645220e1d19a2188b311adfcba314a.zip
FreeBSD-src-26ea86f226645220e1d19a2188b311adfcba314a.tar.gz
Use errx(), remove unused #include. Correct SYNOPSIS
Diffstat (limited to 'usr.bin/expand/expand.c')
-rw-r--r--usr.bin/expand/expand.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/usr.bin/expand/expand.c b/usr.bin/expand/expand.c
index f16f645..fcc7230 100644
--- a/usr.bin/expand/expand.c
+++ b/usr.bin/expand/expand.c
@@ -40,15 +40,14 @@ static const char copyright[] =
#ifndef lint
#if 0
static char sccsid[] = "@(#)expand.c 8.1 (Berkeley) 6/9/93";
-#else
-static const char rcsid[] =
- "$FreeBSD$";
#endif
+static const char rcsid[] =
+ "$FreeBSD$";
#endif /* not lint */
#include <ctype.h>
+#include <err.h>
#include <stdio.h>
-#include <stdlib.h>
#include <unistd.h>
/*
@@ -90,10 +89,8 @@ main(argc, argv)
do {
if (argc > 0) {
- if (freopen(argv[0], "r", stdin) == NULL) {
- perror(argv[0]);
- exit(1);
- }
+ if (freopen(argv[0], "r", stdin) == NULL)
+ errx(1, "%s", argv[0]);
argc--, argv++;
}
column = 0;
@@ -160,18 +157,15 @@ getstops(cp)
i = 0;
while (*cp >= '0' && *cp <= '9')
i = i * 10 + *cp++ - '0';
- if (i <= 0 || i > 256) {
-bad:
- fprintf(stderr, "Bad tab stop spec\n");
- exit(1);
- }
+ if (i <= 0 || i > 256)
+ errx(1, "bad tab stop spec");
if (nstops > 0 && i <= tabstops[nstops-1])
- goto bad;
+ errx(1, "bad tab stop spec");
tabstops[nstops++] = i;
if (*cp == 0)
break;
if (*cp != ',' && *cp != ' ')
- goto bad;
+ errx(1, "bad tab stop spec");
cp++;
}
}
OpenPOWER on IntegriCloud