diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2011-03-15 23:53:31 -0400 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2011-03-15 23:53:31 -0400 |
commit | 01f7f08624f0c942001977415214a578621f6495 (patch) | |
tree | 475731ab0492aee501298e01559dc804658c0275 /gptpart.cc | |
parent | 9a46b042c57144c26a67781d335e6ba4128382d2 (diff) | |
download | sgdisk-01f7f08624f0c942001977415214a578621f6495.tar.gz |
Second patchset from Florian & a few other small changes
Diffstat (limited to 'gptpart.cc')
-rw-r--r-- | gptpart.cc | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -146,11 +146,11 @@ bool GPTPart::operator<(const GPTPart &other) const { // Display summary information; does nothing if the partition is empty. void GPTPart::ShowSummary(int partNum, uint32_t blockSize) { - string sizeInSI; + string sizeInIeee; size_t i; if (firstLBA != 0) { - sizeInSI = BytesToSI(lastLBA - firstLBA + 1, blockSize); + sizeInIeee = BytesToIeee(lastLBA - firstLBA + 1, blockSize); cout.fill(' '); cout.width(4); cout << partNum + 1 << " "; @@ -158,9 +158,10 @@ void GPTPart::ShowSummary(int partNum, uint32_t blockSize) { cout << firstLBA << " "; cout.width(14); cout << lastLBA << " "; - cout << BytesToSI(lastLBA - firstLBA + 1, blockSize) << " "; - for (i = 0; i < 10 - sizeInSI.length(); i++) - cout << " "; + cout << BytesToIeee(lastLBA - firstLBA + 1, blockSize) << " "; + if (sizeInIeee.length() < 10) + for (i = 0; i < 10 - sizeInIeee.length(); i++) + cout << " "; cout.fill('0'); cout.width(4); cout.setf(ios::uppercase); @@ -182,12 +183,12 @@ void GPTPart::ShowDetails(uint32_t blockSize) { cout << "Partition unique GUID: " << uniqueGUID << "\n"; cout << "First sector: " << firstLBA << " (at " - << BytesToSI(firstLBA, blockSize) << ")\n"; + << BytesToIeee(firstLBA, blockSize) << ")\n"; cout << "Last sector: " << lastLBA << " (at " - << BytesToSI(lastLBA, blockSize) << ")\n"; + << BytesToIeee(lastLBA, blockSize) << ")\n"; size = (lastLBA - firstLBA + 1); cout << "Partition size: " << size << " sectors (" - << BytesToSI(size, blockSize) << ")\n"; + << BytesToIeee(size, blockSize) << ")\n"; cout << "Attribute flags: "; cout.fill('0'); cout.width(16); |