OSDN Git Service

Use wfopen instead of fopen & error_msg, saves 64 bytes
authorGlenn L McGrath <bug1@ihug.co.nz>
Fri, 5 Oct 2001 05:24:19 +0000 (05:24 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Fri, 5 Oct 2001 05:24:19 +0000 (05:24 -0000)
coreutils/tee.c
tee.c

index 439cf7d..64a0922 100644 (file)
@@ -45,9 +45,8 @@ tee_main(int argc, char **argv)
        files = (FILE **)xmalloc(sizeof(FILE *) * (argc - optind + 1));
        files[nfiles++] = stdout;
        while (optind < argc) {
-               if ((files[nfiles++] = fopen(argv[optind++], mode)) == NULL) {
+               if ((files[nfiles++] = wfopen(argv[optind++], mode)) == NULL) {
                        nfiles--;
-                       perror_msg("%s", argv[optind-1]);
                        status = 1;
                }
        }
diff --git a/tee.c b/tee.c
index 439cf7d..64a0922 100644 (file)
--- a/tee.c
+++ b/tee.c
@@ -45,9 +45,8 @@ tee_main(int argc, char **argv)
        files = (FILE **)xmalloc(sizeof(FILE *) * (argc - optind + 1));
        files[nfiles++] = stdout;
        while (optind < argc) {
-               if ((files[nfiles++] = fopen(argv[optind++], mode)) == NULL) {
+               if ((files[nfiles++] = wfopen(argv[optind++], mode)) == NULL) {
                        nfiles--;
-                       perror_msg("%s", argv[optind-1]);
                        status = 1;
                }
        }