From 9b144d3c9b3e40dd7d2187204f0c2ddd63711604 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 16 Dec 2025 14:33:33 -0500 Subject: unalf: escape filename in error messages. --- src/extract.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/extract.c b/src/extract.c index a604805..02bd81c 100644 --- a/src/extract.c +++ b/src/extract.c @@ -185,9 +185,12 @@ void extract_alf(void) { new_file = 1; uncrunch_file(); if(bad_checksum) bad_checksum_count++; - if(bytes_written != getquad(alf_hdr_origsize0)) - fprintf(stderr, "%s: %s should be %u bytes, but extracted to %u.\n", - self, out_filename, getquad(alf_hdr_origsize0), bytes_written); + if(bytes_written != getquad(alf_hdr_origsize0)) { + fprintf(stderr, "%s: ", self); + safe_print_filename(out_filename, stderr); + fprintf(stderr, " should be %u bytes, but extracted to %u.\n", + getquad(alf_hdr_origsize0), bytes_written); + } if(!opts.extract_to_stdout) { fclose(out_file); @@ -213,7 +216,9 @@ void extract_alf(void) { void chksum_err(void) { bad_checksum = 1; - fprintf(stderr, "%s: checksum error on %s\n", self, out_filename); + fprintf(stderr, "%s: checksum error on ", self); + safe_print_filename(out_filename, stderr); + fputc('\n', stderr); } void truncated_err(void){ -- cgit v1.2.3