diff --git a/tee.c b/tee.c index 110a5ba..c87acd5 100644 --- a/tee.c +++ b/tee.c @@ -33,11 +33,6 @@ int main(int argc, char * argv[]) { start_arg++; } - if(start_arg >= argc) { - fprintf(stderr, "%s: no file operands provided\n", argv[0]); - return 1; - } - FILE * files[27] = { 0 }; char * mode = append_mode == 1 ? "a+" : "w+"; @@ -47,7 +42,7 @@ int main(int argc, char * argv[]) { files[j++] = fopen(argv[i], mode); if(files == NULL) { fprintf(stderr, "%s: could not open/create file %s\n", argv[0], argv[i]); - return 2; + return 1; } } @@ -67,5 +62,5 @@ int main(int argc, char * argv[]) { } } - return file_failed == 0 ? 0 : 3; + return file_failed == 0 ? 0 : 2; } \ No newline at end of file