From: Eric S. Raymond Date: Sun, 14 Sep 2003 21:32:47 +0000 (+0000) Subject: Detect excessively larhe files. X-Git-Tag: 1.6~18 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=d00ec7f9bdf5faf72719a01d36e3749b13e86d2f;p=comparator.git Detect excessively larhe files. --- diff --git a/shredtree.c b/shredtree.c index 9c81542..e74466d 100644 --- a/shredtree.c +++ b/shredtree.c @@ -181,6 +181,12 @@ int shredfile(struct filehdr_t *file, int braceline = 0; linecount++; + if (linecount >= MAX_LINENUM) + { + fprintf(stderr, "comparator: %s too large, only first %d lines will be compared.\n", file->name, MAX_LINENUM-1); + break; + } + if (remove_braces) { char *cp;