Gutenberg tweaks

Changed the catalog scan offset so we don't overrun the buffer.

Changed a strcpy() to strncpy().

Added Gutenberg to the list of formats MDC outputs.
This commit is contained in:
Andy McFadden 2015-01-09 18:19:14 -08:00
parent 090797a76f
commit 1362c73a7e
3 changed files with 11 additions and 4 deletions

View File

@ -22,7 +22,7 @@ const int kMaxVolNameLen = 9;
const int kSctSize = 256;
const int kVTOCTrack = 17;
const int kVTOCSector = 7;
const int kCatalogEntryOffset = 0x20; // first entry in cat sect starts here
const int kCatalogEntryOffset = 0x10; // first entry in cat sect starts here
const int kCatalogEntrySize = 16; // length in bytes of catalog entries
const int kCatalogEntriesPerSect = 15; // #of entries per catalog sector
const int kEntryDeleted = 0x40; // this is used to designate deleted files

View File

@ -348,9 +348,10 @@ LoadDiskFSContents(DiskFS* pDiskFS, const char* volName,
if (strlen(ccp) == 0)
ccp = kBlankFileName;
if (subVolName[0] == '\0')
strcpy(dispName, ccp);
else {
if (subVolName[0] == '\0') {
strncpy(dispName, ccp, sizeof(dispName));
dispName[sizeof(dispName) - 1] = '\0';
} else {
snprintf(dispName, sizeof(dispName), "%s:%s", subVolName, ccp);
//dispName = subVolName;
//dispName += ':';
@ -470,6 +471,9 @@ LoadDiskFSContents(DiskFS* pDiskFS, const char* volName,
case DiskImg::kFormatRDOS3:
fmtStr = "RDOS ";
break;
case DiskImg::kFormatGutenberg:
fmtStr = "Gutenb";
break;
default:
fmtStr = "??? ";
break;

View File

@ -856,6 +856,9 @@ int MainWindow::LoadDiskFSContents(DiskFS* pDiskFS, const char* volName,
case DiskImg::kFormatMSDOS:
fmtStr = "MS-DOS";
break;
case DiskImg::kFormatGutenberg:
fmtStr = "Gutenb";
break;
default:
fmtStr = "??? ";
break;