summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-07-06 03:39:37 +0000
committerbde <bde@FreeBSD.org>1997-07-06 03:39:37 +0000
commit5deeab0f5c22102ea29a654e43b0b05e6f7074f5 (patch)
tree30ee85f8b24cfa032ebe5ff4e0817a54b37fc303 /usr.bin
parentc51869ac71c7fca37b322a5f65dcfed3e8ceea2d (diff)
downloadFreeBSD-src-5deeab0f5c22102ea29a654e43b0b05e6f7074f5.zip
FreeBSD-src-5deeab0f5c22102ea29a654e43b0b05e6f7074f5.tar.gz
Merge from Lite2 (reject widths <= 0 instead of pretending that they are 80).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/banner/banner.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c
index 566286f..13a2849 100644
--- a/usr.bin/banner/banner.c
+++ b/usr.bin/banner/banner.c
@@ -38,7 +38,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)banner.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)banner.c 8.4 (Berkeley) 4/29/95";
#endif /* not lint */
/*
@@ -1026,26 +1026,26 @@ int width = DWIDTH; /* -w option: scrunch letters to 80 columns */
int
main(argc, argv)
int argc;
- char **argv;
+ char *argv[];
{
int ch;
while ((ch = getopt(argc, argv, "w:td")) != -1)
- switch(ch) {
- case 'w':
- width = atoi(optarg);
- if (width <= 0)
- width = 80;
- break;
+ switch (ch) {
case 'd':
debug = 1;
break;
case 't':
trace = 1;
break;
+ case 'w':
+ width = atoi(optarg);
+ if (width <= 0)
+ errx(1, "illegal argument for -w option");
+ break;
case '?':
default:
- fprintf(stderr, "usage: banner [-w width]\n");
+ (void)fprintf(stderr, "usage: banner [-w width]\n");
exit(1);
}
argc -= optind;
OpenPOWER on IntegriCloud