diff options
author | John Ankarstrom <john@ankarstrom.se> | 2021-07-06 21:46:44 +0200 |
---|---|---|
committer | John Ankarstrom <john@ankarstrom.se> | 2021-07-06 21:46:57 +0200 |
commit | 8558abc41b8d0515e07b552ca746f62c30c7502d (patch) | |
tree | fd8e54f9d8d5c485fdc647190c7aee4ff14e1a36 | |
parent | 0861d76717ceaff31bf8172e6fa117c8f03d536e (diff) | |
download | build-8558abc41b8d0515e07b552ca746f62c30c7502d.tar.gz |
Read no more than 20 lines from each file
-rw-r--r-- | build.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 */ |