aboutsummaryrefslogtreecommitdiff
path: root/src/extract.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/extract.c')
-rw-r--r--src/extract.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/extract.c b/src/extract.c
index 31559cf..9c45941 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -7,6 +7,7 @@
#include "unalf.h"
#include "addrs.h"
+int bad_checksum, bad_checksum_count = 0;
char *out_filename;
void dpoke(int addr, u16 value) {
@@ -87,15 +88,27 @@ void extract_alf(void) {
out_filename = realname;
}
+ bad_checksum = 0;
uncrunch_file();
+ if(bad_checksum) bad_checksum_count++;
if(!opts.extract_to_stdout) fclose(out_file);
out_filename = 0;
}
+
+ if(opts.testonly && !opts.quiet) {
+ if(bad_checksum_count)
+ printf("%d file%s with bad checksum!\n",
+ bad_checksum_count,
+ bad_checksum_count == 1 ? "" : "s");
+ else
+ printf("All files OK.\n");
+ }
}
static void chksum_err(void) {
- fprintf(stderr, "%s: checksum error on file %s\n", self, out_filename);
+ bad_checksum = 1;
+ fprintf(stderr, "%s: checksum error on %s\n", self, out_filename);
}
void uncrunch_file(void) {