aboutsummaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-11-21 05:20:35 -0500
committerB. Watson <urchlay@slackware.uk>2025-11-21 05:20:35 -0500
commit44541066424e2ff1490f25a2b512a1a609506243 (patch)
tree1cff011cf6b64522d80bfb50dfcffeb44268410a /src/io.c
parent24dd2ee784574cf3b21d19421015ac67034a22d0 (diff)
downloadunalf-44541066424e2ff1490f25a2b512a1a609506243.tar.gz
Complain if extracted file size doesn't match orig size in ALF header.
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/io.c b/src/io.c
index 9a3f97d..9b664d4 100644
--- a/src/io.c
+++ b/src/io.c
@@ -142,5 +142,10 @@ void writeblock(void) {
// fprintf(stderr, "writeblock, bufadr = $%04x, len = $%04x\n", bufadr, len);
bytes = fwrite(buf, 1, len, out_file);
+ if(bytes < 0) {
+ perror(self); /* TODO: out_filename */
+ exit(1);
+ }
+ bytes_written += bytes;
dpoke(buf_len_l, bytes);
}