[gparted] Fix size off by one sector with unrecognized disk label (#649444)



commit 53b2b50f4a2190d15682b0a1b954b4beeed17ebd
Author: Curtis Gedak <gedakc gmail com>
Date:   Tue May 31 09:41:10 2011 -0600

    Fix size off by one sector with unrecognized disk label (#649444)
    
    On disks with an unrecognized disk label, the end sector value
    was saved as one sector larger than actual.  This caused the
    Partition Information dialog to report the end sector value and
    the total number of sectors on the disk as one larger than the
    actual value.
    
    Closes Bug #649444 - Partition information reports wrong sector
                         count

 src/GParted_Core.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index f3ed5a6..847ca74 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -331,7 +331,7 @@ void GParted_Core::set_devices( std::vector<Device> & devices )
 				Partition partition_temp ;
 				partition_temp .Set_Unallocated( temp_device .get_path(),
 								 0,
-								 temp_device .length,
+								 temp_device .length - 1,
 								 temp_device .sector_size,
 								 false );
 				//Place libparted messages in this unallocated partition



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