Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
tadd committed Jul 15, 2024
1 parent 3380602 commit 719cf31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ static FILE *parse_opt(int argc, char *const *argv)
exit(2);
}
}
if (argv[optind]) {
const char *f = argv[optind];
const char *f = argv[optind];
if (f) {
if (in != NULL)
error("filename %s given while option '-e' passed", f);
in = fopen(f, "r");
if (in == NULL)
error("file %s not found", f);
error("can't read file %s", f);
}
return in ? in : stdin;
}
Expand Down

0 comments on commit 719cf31

Please sign in to comment.