summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2002-05-08 04:22:29 (GMT)
committerdavygrvy <davygrvy@pobox.com>2002-05-08 04:22:29 (GMT)
commit0fe16f67db4311850f0ffe0df7a95b94f43d5aa5 (patch)
tree34fa315b0fa70d5d42407b04ba53a4cbe76f3521
parent030f4c023479b3098d9231c080dc0563872dbdd9 (diff)
downloadtcl-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>.
-rw-r--r--tools/man2tcl.c10
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.