From 8558abc41b8d0515e07b552ca746f62c30c7502d Mon Sep 17 00:00:00 2001 From: John Ankarstrom Date: Tue, 6 Jul 2021 21:46:44 +0200 Subject: Read no more than 20 lines from each file --- build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.c b/build.c index 230dea9..bd17187 100644 --- a/build.c +++ b/build.c @@ -51,7 +51,7 @@ main(int argc, char *argv[]) if (!fp) err(1, "fopen"); /* read line by line */ - while (fgets(buf, sizeof(buf), fp)) { + for (j = 0; j < 20 && fgets(buf, sizeof(buf), fp); j++) { buf[strcspn(buf, "\n")] = 0; /* parse line */ -- cgit v1.2.3