From 81fe95cce4e1f0c4ae7d2239fc0a924b538d76a7 Mon Sep 17 00:00:00 2001 From: Daniel Serpell Date: Sun, 21 Apr 2024 21:43:50 -0400 Subject: [PATCH] Don't show errors on small ATR files. --- src/lsdos.c | 4 +--- src/lssfs.c | 11 ++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lsdos.c b/src/lsdos.c index 610fdb6..119444e 100644 --- a/src/lsdos.c +++ b/src/lsdos.c @@ -286,10 +286,8 @@ int dos_read(struct atr_image *atr, const char *atr_name, int atari_list, int lo // Read VTOC const uint8_t *vtoc = atr_data(atr, 360); if( !vtoc ) - { - show_msg("%s: ATR image with too few sectors.", atr_name); return 1; - } + unsigned signature = vtoc[0]; unsigned alloc_sect = read16(vtoc + 1); unsigned free_sect = read16(vtoc + 3); diff --git a/src/lssfs.c b/src/lssfs.c index 47dfdc0..37a48e4 100644 --- a/src/lssfs.c +++ b/src/lssfs.c @@ -313,11 +313,6 @@ int sfs_read(struct atr_image *atr, const char *atr_name, int atari_list, int lo int extract_files) { // Check SFS filesystem - if( atr->sec_count < 6 ) - { - show_msg("%s: ATR image with too few sectors.", atr_name); - return 1; - } // Read superblock const uint8_t *boot = atr_data(atr, 1); unsigned signature = boot[7]; @@ -353,6 +348,12 @@ int sfs_read(struct atr_image *atr, const char *atr_name, int atari_list, int lo return 1; } + if( atr->sec_count < 6 ) + { + show_msg("%s: ATR image with too few sectors.", atr_name); + return 1; + } + if( atari_list ) printf("ATR image: %s\n" "Image size: %u sectors of %u bytes\n"