fix off by one in getting the first usable sector
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1083353
This commit is contained in:
parent
17f37760ae
commit
8ecc3ccdf3
|
@ -103,7 +103,7 @@ quint64 LibParted::firstUsableSector(const Device& d)
|
|||
PedDevice* pedDevice = ped_device_get(d.deviceNode().toAscii());
|
||||
PedDisk* pedDisk = pedDevice ? ped_disk_new(pedDevice) : NULL;
|
||||
|
||||
quint64 rval = pedDisk->dev->bios_geom.sectors + 1;
|
||||
quint64 rval = pedDisk->dev->bios_geom.sectors;
|
||||
|
||||
if (pedDisk && strcmp(pedDisk->type->name, "gpt") == 0)
|
||||
{
|
||||
|
|
|
@ -564,7 +564,7 @@ void PartitionTable::setTypeName(const QString& s)
|
|||
|
||||
qint64 PartitionTable::defaultFirstUsable(const Device& d, const QString&)
|
||||
{
|
||||
return d.sectorsPerTrack();
|
||||
return d.sectorsPerTrack() - 1;
|
||||
}
|
||||
|
||||
qint64 PartitionTable::defaultLasttUsable(const Device& d, const QString& t)
|
||||
|
|
Loading…
Reference in New Issue