From 44541066424e2ff1490f25a2b512a1a609506243 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 21 Nov 2025 05:20:35 -0500 Subject: Complain if extracted file size doesn't match orig size in ALF header. --- src/extract.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/extract.c') diff --git a/src/extract.c b/src/extract.c index aa7f75b..0fb61f4 100644 --- a/src/extract.c +++ b/src/extract.c @@ -3,6 +3,7 @@ int bad_checksum, bad_checksum_count = 0; int new_file = 0; +unsigned int bytes_written = 0; char *out_filename; void dpoke(int addr, u16 value) { @@ -153,10 +154,13 @@ void extract_alf(void) { out_filename = realname; } - bad_checksum = 0; + bad_checksum = bytes_written = 0; 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(!opts.extract_to_stdout) fclose(out_file); out_filename = 0; -- cgit v1.2.3