-/* $NetBSD: banner.c,v 1.14 2005/06/27 20:32:07 rillig Exp $ */
+/* $NetBSD: banner.c,v 1.17 2008/07/20 01:03:20 lukem Exp $ */
/*
* Copyright (c) 1980, 1993, 1994
#include <sys/cdefs.h>
#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1980, 1993, 1994\n\
- The Regents of the University of California. All rights reserved.\n");
+__COPYRIGHT("@(#) Copyright (c) 1980, 1993, 1994\
+ The Regents of the University of California. All rights reserved.");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)banner.c 8.4 (Berkeley) 4/29/95";
#else
-__RCSID("$NetBSD: banner.c,v 1.14 2005/06/27 20:32:07 rillig Exp $");
+__RCSID("$NetBSD: banner.c,v 1.17 2008/07/20 01:03:20 lukem Exp $");
#endif
#endif /* not lint */
errx(EXIT_FAILURE, "message too long");
}
-int main(int, char *[]);
-
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
break;
case 'w':
width = atoi(optarg);
- if (width <= 0)
+ if (width <= 0 || width > DWIDTH)
errx(1, "illegal argument for -w option");
break;
case '?':
argv += optind;
for (i = 0; i < width; i++) {
- j = i * 132 / width;
+ j = i * DWIDTH / width;
print[j] = 1;
}
exit(1);
}
x = data_table[pc];
- if (trace)
- printf("pc=%d, term=%d, max=%d, linen=%d, x=%d\n",pc,term,max,linen,x);
+ if (trace) {
+ printf("pc=%d, term=%d, max=%d, linen=%d, x=%d",
+ pc,term,max,linen,x);
+ printf("\n");
+ }
if (x >= 128) {
if (x>192) term++;
x = x & 63;