summaryrefslogtreecommitdiff
path: root/tapls.c
diff options
context:
space:
mode:
Diffstat (limited to 'tapls.c')
-rw-r--r--tapls.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/tapls.c b/tapls.c
index 3442c76..c00ec47 100644
--- a/tapls.c
+++ b/tapls.c
@@ -83,6 +83,7 @@ static void TAPLoad(const char *path, FILE **tapfile)
{
Z80Word blen;
Z80Byte type,b,csum,tape_csum;
+ int warned = FALSE;
b = 0;
@@ -105,22 +106,24 @@ static void TAPLoad(const char *path, FILE **tapfile)
while(blen)
{
- b=GetTAPByte(tapfile);
- csum^=b;
- blen--;
- }
+ b = GetTAPByte(tapfile);
+
+ if (!*tapfile && !warned)
+ {
+ fprintf(stderr,"%s: hit EOF during block (%u left)\n", path,
+ blen);
+ warned = TRUE;
+ }
+
+ if (blen > 1)
+ {
+ csum ^= b;
+ }
- /* Get the checksum
- */
- if (blen)
- {
- tape_csum=GetTAPByte(tapfile);
blen--;
}
- else
- {
- tape_csum=b;
- }
+
+ tape_csum = b;
/* Check the checksum
*/