]> thyrsus.com Git - comparator.git/commitdiff
Detect excessively larhe files.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 14 Sep 2003 21:32:47 +0000 (21:32 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 14 Sep 2003 21:32:47 +0000 (21:32 +0000)
shredtree.c

index 9c81542967f0de62e4e0dd20b0cf86011e7f1ce0..e74466da86c60e5b8eca1b87fba6dfd6244117d2 100644 (file)
@@ -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;