diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2011-12-18 16:35:25 -0500 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2011-12-18 16:35:25 -0500 |
commit | 0541b56fee4e92822340a2b2387508dd58d0ca7c (patch) | |
tree | 7ecbdb2db2e937a52a84b1ae8bcabb89395fd6b3 /gpt.cc | |
parent | 23d8d54cdffa9bab0395dab92faa1990410bbb9a (diff) | |
download | sgdisk-0541b56fee4e92822340a2b2387508dd58d0ca7c.tar.gz |
Minor bug fixes
Diffstat (limited to 'gpt.cc')
-rw-r--r-- | gpt.cc | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -968,11 +968,9 @@ int GPTData::CheckTable(struct GPTHeader *header) { // Writes GPT (and protective MBR) to disk. If quiet==1, // Returns 1 on successful write, 0 if there was a problem. int GPTData::SaveGPTData(int quiet) { - int allOK = 1, littleEndian; + int allOK = 1; char answer; - littleEndian = IsLittleEndian(); - // First do some final sanity checks.... // This test should only fail on read-only disks.... @@ -1172,14 +1170,10 @@ int GPTData::SavePartitionTable(DiskIO & disk, uint64_t sector) { // set of partitions. int GPTData::LoadGPTBackup(const string & filename) { int allOK = 1, val, err; - uint32_t sizeOfEntries; - int littleEndian = 1, shortBackup = 0; + int shortBackup = 0; DiskIO backupFile; if (backupFile.OpenForRead(filename)) { - if (IsLittleEndian() == 0) - littleEndian = 0; - // Let the MBRData class load the saved MBR... protectiveMBR.ReadMBRData(&backupFile, 0); // 0 = don't check block size protectiveMBR.SetDisk(&myDisk); @@ -1207,10 +1201,8 @@ int GPTData::LoadGPTBackup(const string & filename) { if ((val = CheckHeaderValidity()) > 0) { if (val == 2) { // only backup header seems to be good SetGPTSize(secondHeader.numParts); - sizeOfEntries = secondHeader.sizeOfPartitionEntries; } else { // main header is OK SetGPTSize(mainHeader.numParts); - sizeOfEntries = mainHeader.sizeOfPartitionEntries; } // if/else if (secondHeader.currentLBA != diskSize - UINT64_C(1)) { |