diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-11-21 15:49:56 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-11-21 15:49:56 -0500 |
| commit | 23abb4764a4be094608a14a6637f08e8f3067a76 (patch) | |
| tree | d82720f6a0c08660d64228d71aefa8147063b1e0 /src | |
| parent | 61a771939849fd57b914727f29480b5b8c0dea7f (diff) | |
| download | unalf-23abb4764a4be094608a14a6637f08e8f3067a76.tar.gz | |
Add fatal: prefix to fatal error messages.
Diffstat (limited to 'src')
| -rw-r--r-- | src/extract.c | 10 | ||||
| -rw-r--r-- | src/io.c | 7 | ||||
| -rw-r--r-- | src/listalf.c | 3 | ||||
| -rw-r--r-- | src/opts.c | 4 | ||||
| -rw-r--r-- | src/unalf.c | 6 |
5 files changed, 15 insertions, 15 deletions
diff --git a/src/extract.c b/src/extract.c index 0fb61f4..b2ee615 100644 --- a/src/extract.c +++ b/src/extract.c @@ -123,8 +123,7 @@ void extract_alf(void) { if(!file_wanted(out_filename)) { if(fseek(in_file, getquad(alf_hdr_compsize0), SEEK_CUR) != 0) { - fputs(self, stderr); - perror(": fseek"); + fprintf(stderr, "%s: fatal: seek failed on input!\n", self); exit(1); } out_filename = 0; @@ -147,6 +146,7 @@ void extract_alf(void) { } if(!(out_file = fopen(out_filename, "wb"))) { + fprintf(stderr, "%s: fatal: ", self); perror(out_filename); exit(1); } @@ -182,16 +182,16 @@ void chksum_err(void) { } void unknown_err(void){ - fprintf(stderr, "%s: unknown error (L7712)\n", self); + fprintf(stderr, "%s: fatal: unknown error (L7712)\n", self); exit(1); } void stack_underrun(void){ - fprintf(stderr, "%s: stack underrun\n", self); + fprintf(stderr, "%s: fatal: stack underrun\n", self); exit(1); } void stack_overrun(void){ - fprintf(stderr, "%s: stack overrun\n", self); + fprintf(stderr, "%s: fatal: stack overrun\n", self); exit(1); } @@ -5,12 +5,12 @@ static int headers_read = 0; static int convert_eols = 0; static void die_arc(void) { - fprintf(stderr, "%s: this is an ARC file, not ALF\n", self); + fprintf(stderr, "%s: fatal: this is an ARC file, not ALF\n", self); exit(1); } static void die_not_alf(void) { - fprintf(stderr, "%s: not an ALF file\n", self); + fprintf(stderr, "%s: fatal: not an ALF file\n", self); exit(1); } @@ -143,7 +143,8 @@ void writeblock(void) { bytes = fwrite(buf, 1, len, out_file); if(bytes < 0) { - perror(self); /* TODO: out_filename */ + fprintf(stderr, "%s: fatal: ", self); + perror("write failed"); /* TODO: out_filename */ exit(1); } bytes_written += bytes; diff --git a/src/listalf.c b/src/listalf.c index 2c236c9..8082d11 100644 --- a/src/listalf.c +++ b/src/listalf.c @@ -109,8 +109,7 @@ void list_alf(void) { } if(fseek(in_file, comp_size, SEEK_CUR) != 0) { - fputs(self, stderr); - perror(": fseek"); + fprintf(stderr, "%s: fatal: seek failed on input!\n", self); exit(1); } } @@ -45,13 +45,13 @@ void parse_opts(int argc, char * const *argv) { case 'd': opts.outdir = optarg; break; case 'x': add_exclude(optarg); break; default: - fprintf(stderr, "%s: invalid option (try -h or --help)\n", self); + fprintf(stderr, "%s: fatal: invalid option (try -h or --help)\n", self); exit(1); } } if(optind >= argc) { - fprintf(stderr, "%s: missing alf file argument (try -h or --help)\n", self); + fprintf(stderr, "%s: fatal: missing alf file argument (try -h or --help)\n", self); exit(1); } diff --git a/src/unalf.c b/src/unalf.c index ee235b1..9a43bb2 100644 --- a/src/unalf.c +++ b/src/unalf.c @@ -21,13 +21,13 @@ static void create_outdir(void) { mkdir(opts.outdir, 0777); #endif if(r < 0 && errno != EEXIST) { - fprintf(stderr, "%s: ", self); + fprintf(stderr, "%s: fatal: ", self); perror(opts.outdir); exit(1); } if(chdir(opts.outdir) < 0) { - fprintf(stderr, "%s: ", self); + fprintf(stderr, "%s: fatal: ", self); perror(opts.outdir); exit(1); } @@ -61,7 +61,7 @@ int main(int argc, char **argv) { parse_opts(argc, argv); if(!(in_file = fopen(in_filename, "rb"))) { - fprintf(stderr, "%s: ", self); + fprintf(stderr, "%s: fatal: ", self); perror(in_filename); exit(1); } |
