aboutsummaryrefslogtreecommitdiff
path: root/name.c
diff options
context:
space:
mode:
Diffstat (limited to 'name.c')
-rw-r--r--name.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/name.c b/name.c
index 26f6c8c..e9c13d7 100644
--- a/name.c
+++ b/name.c
@@ -19,8 +19,7 @@ void waitstdin(void);
int
main(int argc, char *argv[])
{
- char file[30], *name, from[MAXLINE], *froms[MAXFILES],
- *tmp, to[MAXLINE], *tos[MAXFILES];
+ char file[30], *name, *froms[MAXFILES], *tmp, *tos[MAXFILES];
FILE *fp;
int c, i, j, s, xflag;
@@ -65,15 +64,15 @@ usage: fprintf(stderr, "usage: %s [-x]\n", name);
err(1, "fopen");
/* Read original file names. */
- for (i = 0; fgets(from, MAXLINE, fp); i++) {
- from[strcspn(from, "\n")] = 0;
- strcpy(froms[i], from);
+ for (i = 0; fgets(tmp, MAXLINE, fp); i++) {
+ tmp[strcspn(tmp, "\n")] = 0;
+ strcpy(froms[i], tmp);
}
/* Read new file names. */
- for (j = 0; fgets(to, MAXLINE, stdin); j++) {
- to[strcspn(to, "\n")] = 0;
- strcpy(tos[j], to);
+ for (j = 0; fgets(tmp, MAXLINE, stdin); j++) {
+ tmp[strcspn(tmp, "\n")] = 0;
+ strcpy(tos[j], tmp);
}
if (i != j) {