Skip to content

Commit

Permalink
dos33: mkdos33fs: fix really embarassing = vs == bug
Browse files Browse the repository at this point in the history
the catalog code was mostly working by accident

should never have learned Pascal first
  • Loading branch information
deater committed Sep 6, 2022
1 parent bd9ab19 commit 301eb86
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions utils/dos33fs-utils/dos33.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,18 +429,20 @@ static int dos33_add_file(unsigned char *vtoc,
i++;
}

if ((catalog_track=0x11) && (catalog_sector==1)) {
/* in theory can only have 105 files */
catalog_track=catalog_buffer[CATALOG_NEXT_T];
catalog_sector=catalog_buffer[CATALOG_NEXT_S];

if ((catalog_track==0x0) && (catalog_sector==0)) {
/* FIXME: should really check this before we */
/* allocate space for the file, we leak */

/* if full, we have no recourse! */
/* can we allocate new catalog sectors */
/* can we auto-allocate new catalog sectors? */
/* and point to them?? */
fprintf(stderr,"Error! No more room for files!\n");
return -ERROR_CATALOG_FULL;
}

catalog_track=catalog_buffer[CATALOG_NEXT_T];
catalog_sector=catalog_buffer[CATALOG_NEXT_S];

goto continue_parsing_catalog;

got_a_dentry:
Expand Down

0 comments on commit 301eb86

Please sign in to comment.