Fix available space calculation in Dialog_Partition_New::set_data()

The available number of sectors 'total_length' is calculated as one
sector too few.  However this doesn't matter because when composing a
new partition in Dialog_Partition_New::Get_New_Partition() the dialog
fits the end of the partition to the end of the unallocated partition
'new_partition->sector_end' in which it is being created, not the
available space.  Missed in earlier commit:
    4f84cff781
    cleanups

Anyway correct the calculation.
This commit is contained in:
Mike Fleetwood 2020-04-20 22:43:46 +01:00 committed by Curtis Gedak
parent 3a53d17c8d
commit c8b4df5879
1 changed files with 1 additions and 1 deletions

View File

@ -183,7 +183,7 @@ void Dialog_Partition_New::set_data( const Device & device,
//set some widely used values...
MIN_SPACE_BEFORE_MB = Dialog_Base_Partition::MB_Needed_for_Boot_Record( selected_partition );
START = selected_partition.sector_start;
total_length = selected_partition.sector_end - selected_partition.sector_start;
total_length = selected_partition.get_sector_length();
TOTAL_MB = Utils::round( Utils::sector_to_unit( selected_partition.get_sector_length(),
selected_partition.sector_size, UNIT_MIB ) );
MB_PER_PIXEL = TOTAL_MB / 500.00 ;