mirror of
https://github.com/Michaelangel007/apple2_prodos_utils.git
synced 2026-10-22 00:02:22 +00:00
Fix off-by-one block used size.
This commit is contained in:
1 parent
8e82d82f81
commit
1489ffe543
1 file changed
+1
-4
+1
-4
@@ -1100,7 +1100,6 @@ bool ProDOS_FileAdd( const char *to_path, const char *from_filename, ProDOS_File
|
||||
printf( "DEBUG: ADD: Path @ %06X\n", base );
|
||||
#endif
|
||||
|
||||
|
||||
// int nDirBlocks = prodos_BlockGetDirectoryCount();
|
||||
// int nDirEntriesTotal = 0;
|
||||
// int nDirEntriesFree = 0;
|
||||
@@ -1126,7 +1125,6 @@ bool ProDOS_FileAdd( const char *to_path, const char *from_filename, ProDOS_File
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Block Management
|
||||
|
||||
int nSrcSize = File_Size( pSrcFile );
|
||||
@@ -1149,7 +1147,6 @@ bool ProDOS_FileAdd( const char *to_path, const char *from_filename, ProDOS_File
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
uint8_t *buffer = new uint8_t[ nSrcSize + PRODOS_BLOCK_SIZE ];
|
||||
memset( buffer, 0, nSrcSize + PRODOS_BLOCK_SIZE );
|
||||
|
||||
@@ -1280,7 +1277,7 @@ bool ProDOS_FileAdd( const char *to_path, const char *from_filename, ProDOS_File
|
||||
|
||||
entry.kind = iKind;
|
||||
entry.inode = iNode;
|
||||
entry.blocks = nBlocksTotal;
|
||||
entry.blocks = nBlocksData; // Note: File Entry does NOT include meta file block(s)
|
||||
entry.size = nSrcSize;
|
||||
entry.dir_block = iDirBlock;
|
||||
|
||||
|
||||
Reference in new issue
Block a user