From 1f9d41f0066b21aab14518dc4cbc7d8980efd9c4 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sat, 11 Nov 2023 20:34:34 +0100 Subject: better error messages --- rpt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rpt.c b/rpt.c index 1d1f0cb..327b8b8 100644 --- a/rpt.c +++ b/rpt.c @@ -146,7 +146,6 @@ copy_stdin() } clone_fd = fileno(stdin_clone); - errno = 0; while ((nbytes = read(STDIN_FILENO, buf, BUFSIZE)) > 0) { @@ -198,7 +197,7 @@ main(int argc, char* argv[]) print_version(); return 0; case ':': - fprintf(stderr, "COUNT value missing.\n"); + fprintf(stderr, "rpt: COUNT value missing\n"); print_usage(stderr); return 1; /* invalid option */ default: @@ -214,7 +213,7 @@ main(int argc, char* argv[]) if (err && (*err != '\0')) { - fprintf(stderr, "Failed to read COUNT : '%s'.\n", + fprintf(stderr, "rpt: failed to convert COUNT : '%s'\n", strcount); return 2; } @@ -222,7 +221,7 @@ main(int argc, char* argv[]) if (optind >= argc) { - fprintf(stderr, "rpt: no command provided.\n"); + fprintf(stderr, "rpt: no command provided\n"); return 3; } -- cgit v1.2.3