diff options
author | davygrvy <davygrvy@pobox.com> | 2002-05-08 04:22:29 (GMT) |
---|---|---|
committer | davygrvy <davygrvy@pobox.com> | 2002-05-08 04:22:29 (GMT) |
commit | 0fe16f67db4311850f0ffe0df7a95b94f43d5aa5 (patch) | |
tree | 34fa315b0fa70d5d42407b04ba53a4cbe76f3521 /tools/man2tcl.c | |
parent | 030f4c023479b3098d9231c080dc0563872dbdd9 (diff) | |
download | tcl-0fe16f67db4311850f0ffe0df7a95b94f43d5aa5.zip tcl-0fe16f67db4311850f0ffe0df7a95b94f43d5aa5.tar.gz tcl-0fe16f67db4311850f0ffe0df7a95b94f43d5aa5.tar.bz2 |
Increased line buffer size and a bail-out if that should ever be over-run.
Changes from Peter Spjuth <peter.spjuth@space.se>.
Diffstat (limited to 'tools/man2tcl.c')
-rw-r--r-- | tools/man2tcl.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/man2tcl.c b/tools/man2tcl.c index 666b885..cbafb8e 100644 --- a/tools/man2tcl.c +++ b/tools/man2tcl.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: man2tcl.c,v 1.4 1999/12/06 01:43:15 wart Exp $ + * RCS: @(#) $Id: man2tcl.c,v 1.5 2002/05/08 04:22:29 davygrvy Exp $ */ static char sccsid[] = "@(#) man2tcl.c 1.3 95/08/12 17:34:08"; @@ -88,7 +88,7 @@ main(argc, argv) char **argv; /* Values of command-line arguments. */ { FILE *f; -#define MAX_LINE_SIZE 500 +#define MAX_LINE_SIZE 1000 char line[MAX_LINE_SIZE]; char *p; @@ -136,6 +136,12 @@ main(argc, argv) continue; } + if (strlen(line) >= MAX_LINE_SIZE -1) { + fprintf(stderr, "Too long line. Max is %d chars.\n", + MAX_LINE_SIZE - 1); + exit(1); + } + if ((line[0] == '.') || (line[0] == '\'')) { /* * This line is a macro invocation. |