Skip to content

Commit

Permalink
Don't show errors on small ATR files.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsc committed Apr 22, 2024
1 parent 2e82c66 commit 81fe95c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/lsdos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 6 additions & 5 deletions src/lssfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 81fe95c

Please sign in to comment.