aboutsummaryrefslogtreecommitdiff
path: root/center.c
diff options
context:
space:
mode:
Diffstat (limited to 'center.c')
-rw-r--r--center.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/center.c b/center.c
index ce0d50e..3192aa5 100644
--- a/center.c
+++ b/center.c
@@ -67,10 +67,13 @@ main(int argc, char **argv)
center(stdin);
else {
FILE *fp;
- if ((fp = fopen(*argv, "r")) == NULL)
- errx(EXIT_FAILURE, "fopen");
- center(fp);
- fclose(fp);
+ if ((fp = fopen(*argv, "r")) == NULL) {
+ warn("fopen");
+ rval = EXIT_FAILURE;
+ } else {
+ center(fp);
+ fclose(fp);
+ }
}
} while (*++argv);