mirror of
https://github.com/Michaelangel007/apple2_prodos_utils.git
synced 2025-02-19 20:30:29 +00:00
Fix off-by-one block used size.
This commit is contained in:
parent
8e82d82f81
commit
1489ffe543
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user