summaryrefslogtreecommitdiff
path: root/gptpart.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2011-03-15 23:53:31 -0400
committersrs5694 <srs5694@users.sourceforge.net>2011-03-15 23:53:31 -0400
commit01f7f08624f0c942001977415214a578621f6495 (patch)
tree475731ab0492aee501298e01559dc804658c0275 /gptpart.cc
parent9a46b042c57144c26a67781d335e6ba4128382d2 (diff)
downloadsgdisk-01f7f08624f0c942001977415214a578621f6495.tar.gz
Second patchset from Florian & a few other small changes
Diffstat (limited to 'gptpart.cc')
-rw-r--r--gptpart.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/gptpart.cc b/gptpart.cc
index 062206a..a938c52 100644
--- a/gptpart.cc
+++ b/gptpart.cc
@@ -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);