summaryrefslogtreecommitdiffstats
path: root/contrib/one-true-awk/main.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-05-16 19:11:36 +0000
committerru <ru@FreeBSD.org>2005-05-16 19:11:36 +0000
commit78d66df18b9755543261f33b621153a97634a136 (patch)
tree33f1015b814b02b503e72df8a6aea18084ad3991 /contrib/one-true-awk/main.c
parent90fe2c86f7f5001762e4c3af00a323f801d8b737 (diff)
downloadFreeBSD-src-78d66df18b9755543261f33b621153a97634a136.zip
FreeBSD-src-78d66df18b9755543261f33b621153a97634a136.tar.gz
Vendor import of bwk's 24-Apr-2005 release.
Diffstat (limited to 'contrib/one-true-awk/main.c')
-rw-r--r--contrib/one-true-awk/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/one-true-awk/main.c b/contrib/one-true-awk/main.c
index 2c061bb..5b04218 100644
--- a/contrib/one-true-awk/main.c
+++ b/contrib/one-true-awk/main.c
@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20040207";
+const char *version = "version 20050424";
#define DEBUG
#include <stdio.h>
@@ -45,7 +45,9 @@ extern int errorflag; /* non-zero if any syntax errors; set by yyerror */
int compile_time = 2; /* for error printing: */
/* 2 = cmdline, 1 = compile, 0 = running */
-char *pfile[20]; /* program filenames from -f's */
+#define MAX_PFILE 20 /* max number of -f's */
+
+char *pfile[MAX_PFILE]; /* program filenames from -f's */
int npfile = 0; /* number of filenames */
int curpfile = 0; /* current filename */
@@ -81,6 +83,8 @@ int main(int argc, char *argv[])
argv++;
if (argc <= 1)
FATAL("no program filename");
+ if (npfile >= MAX_PFILE - 1)
+ FATAL("too many -f options");
pfile[npfile++] = argv[1];
break;
case 'F': /* set field separator */
OpenPOWER on IntegriCloud