From 0fe16f67db4311850f0ffe0df7a95b94f43d5aa5 Mon Sep 17 00:00:00 2001 From: davygrvy Date: Wed, 8 May 2002 04:22:29 +0000 Subject: Increased line buffer size and a bail-out if that should ever be over-run. Changes from Peter Spjuth . --- tools/man2tcl.c | 10 ++++++++-- 1 file 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. -- cgit v0.12