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



commit df541b898623a74c000e84d8535215468232f2e0
Author: Seth Hunter <hunter ll mit edu>
Date:   Mon Sep 28 16:32:04 2009 -0600

    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

 src/Dialog_Partition_New.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/Dialog_Partition_New.cc b/src/Dialog_Partition_New.cc
index 7104601..7990081 100644
--- a/src/Dialog_Partition_New.cc
+++ b/src/Dialog_Partition_New.cc
@@ -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.*/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]