diff options
author | Roderick W. Smith <rodsmith@rodsbooks.com> | 2015-10-18 15:56:31 -0400 |
---|---|---|
committer | Roderick W. Smith <rodsmith@rodsbooks.com> | 2015-10-18 15:56:31 -0400 |
commit | 6aec1dcf15f726b3049412418da59b6e2c882263 (patch) | |
tree | e8dfa65540110a1ba1ea9648b9baea171e95f86b /gptcl.cc | |
parent | 080ff55bc2d1b4d928b30159812033c31ae27ae5 (diff) | |
download | sgdisk-6aec1dcf15f726b3049412418da59b6e2c882263.tar.gz |
Fixed bug in sgdisk that caused --largest-new/-N to fail if fed a
value of "0" for the partition number. (This should work, according to
the man page, and now it does.)
Diffstat (limited to 'gptcl.cc')
-rw-r--r-- | gptcl.cc | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -307,8 +307,8 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { startSector = FindFirstInLargest(); Align(&startSector); endSector = FindLastInFree(startSector); - if (largestPartNum < 0) - largestPartNum = FindFirstFreePart(); + if (largestPartNum <= 0) + largestPartNum = FindFirstFreePart() + 1; if (CreatePartition(largestPartNum - 1, startSector, endSector)) { saveData = 1; } else { |