diff options
Diffstat (limited to 'name.c')
-rw-r--r-- | name.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -64,13 +64,13 @@ usage: fprintf(stderr, "usage: %s [-x]\n", name); err(1, "fopen"); /* Read original file names. */ - for (i = 0; fgets(tmp, MAXLINE, fp); i++) { + for (i = 0; i < MAXFILES && fgets(tmp, MAXLINE, fp); i++) { tmp[strcspn(tmp, "\n")] = 0; strcpy(froms[i], tmp); } /* Read new file names. */ - for (j = 0; fgets(tmp, MAXLINE, stdin); j++) { + for (j = 0; j < MAXFILES && fgets(tmp, MAXLINE, stdin); j++) { tmp[strcspn(tmp, "\n")] = 0; strcpy(tos[j], tmp); } |