diff options
author | davygrvy <davygrvy@noemail.net> | 2002-05-08 04:22:28 (GMT) |
---|---|---|
committer | davygrvy <davygrvy@noemail.net> | 2002-05-08 04:22:28 (GMT) |
commit | e9e3581e49207952d26c1a9ea27144cff981fca5 (patch) | |
tree | 34fa315b0fa70d5d42407b04ba53a4cbe76f3521 /tools | |
parent | 0ba75bfd1cff89f83aa0f7db1f0fb075ef3eb274 (diff) | |
download | tcl-e9e3581e49207952d26c1a9ea27144cff981fca5.zip tcl-e9e3581e49207952d26c1a9ea27144cff981fca5.tar.gz tcl-e9e3581e49207952d26c1a9ea27144cff981fca5.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>.
FossilOrigin-Name: 6e6d790bea147b204f0610bcc413d735206491d4
Diffstat (limited to 'tools')
-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. |