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"