Final 0.6.7 release; minor bug fixes.
diff --git a/gpt.cc b/gpt.cc
index 12aece1..532208f 100644
--- a/gpt.cc
+++ b/gpt.cc
@@ -1363,7 +1363,6 @@
// Clear out old data & prepare basics....
ClearGPTData();
- protectiveMBR.EmptyBootloader();
// Convert the smaller of the # of GPT or MBR partitions
if (numParts > MAX_MBR_PARTS)
@@ -2074,19 +2073,21 @@
uint32_t num = 0;
*largestSegment = UINT64_C(0);
- do {
- firstBlock = FindFirstAvailable(start);
- if (firstBlock != UINT64_C(0)) { // something's free...
- lastBlock = FindLastInFree(firstBlock);
- segmentSize = lastBlock - firstBlock + UINT64_C(1);
- if (segmentSize > *largestSegment) {
- *largestSegment = segmentSize;
+ if (diskSize > 0) {
+ do {
+ firstBlock = FindFirstAvailable(start);
+ if (firstBlock != UINT64_C(0)) { // something's free...
+ lastBlock = FindLastInFree(firstBlock);
+ segmentSize = lastBlock - firstBlock + UINT64_C(1);
+ if (segmentSize > *largestSegment) {
+ *largestSegment = segmentSize;
+ } // if
+ totalFound += segmentSize;
+ num++;
+ start = lastBlock + 1;
} // if
- totalFound += segmentSize;
- num++;
- start = lastBlock + 1;
- } // if
- } while (firstBlock != 0);
+ } while (firstBlock != 0);
+ } // if
*numSegments = num;
return totalFound;
} // GPTData::FindFreeBlocks()