Fix problem with create new partition size off by one sector (#596552)

With "Round to cylinders" deactivated, creating a new partition would
create a partition that was one sector too large.

Closes GParted bug #596552
This commit is contained in:
Seth Hunter 2009-09-28 16:32:04 -06:00 committed by Curtis Gedak
parent d72a662925
commit df541b8986
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ Partition Dialog_Partition_New::Get_New_Partition()
//FIXME: Partition size is limited to just less than 1024 TeraBytes due
// to the maximum value of signed 4 byte integer.
new_start = START + (Sector(spinbutton_before .get_value_as_int()) * MEBIBYTE) ;
new_end = new_start + (Sector(spinbutton_size .get_value_as_int()) * MEBIBYTE) ;
new_end = new_start + (Sector(spinbutton_size .get_value_as_int()) * MEBIBYTE) - 1 ;
/* due to loss of precision during calcs from Sector -> MiB and back, it is possible the new
* partition thinks it's bigger then it can be. Here we try to solve this.*/