aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarstrom <john@ankarstrom.se>2021-07-06 21:46:44 +0200
committerJohn Ankarstrom <john@ankarstrom.se>2021-07-06 21:46:57 +0200
commit8558abc41b8d0515e07b552ca746f62c30c7502d (patch)
treefd8e54f9d8d5c485fdc647190c7aee4ff14e1a36
parent0861d76717ceaff31bf8172e6fa117c8f03d536e (diff)
downloadbuild-8558abc41b8d0515e07b552ca746f62c30c7502d.tar.gz
Read no more than 20 lines from each file
-rw-r--r--build.c2
1 files changed, 1 insertions, 1 deletions
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 */