From: Bastian Dehn Date: Sat, 14 Aug 2021 14:05:35 +0000 (+0200) Subject: change: print to stderr and stdout X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=17e4a574454a47c775bf4481709a0e6d402c96c7;p=discspan.git change: print to stderr and stdout --- diff --git a/src/discspan.c b/src/discspan.c index 21f4a87..abbaddb 100644 --- a/src/discspan.c +++ b/src/discspan.c @@ -51,7 +51,7 @@ param_t read_argument(int argc, char *argv[]) exit(0); break; default: - printf("WARNING: %c unknown option\n", optopt); + fprintf(stderr, "WARNING: %c unknown option\n", optopt); break; } } @@ -74,7 +74,7 @@ void print_human_read_size(const char *output, medium_t medium) if (i > sizeof(einheit)/sizeof(einheit[0])) i = 0; - printf("free space on %s: %lld bytes (%lld %c)\n", output, + fprintf(stdout, "free space on %s: %lld bytes (%lld %c)\n", output, medium.freespace, humanread, einheit[i]); } @@ -85,12 +85,13 @@ int main(int argc, char *argv[]) if (parameter.input == NULL || parameter.output == NULL || parameter.split < 2048) { + fprintf(stderr, "ERROR: missing arguments"); useage(); exit(1); } if (access(parameter.input, F_OK) < 0) { - printf("ERROR: %s file does not exists\n", parameter.input); + fprintf(stderr, "ERROR: %s file does not exists\n", parameter.input); exit(1); }