From 08bb0da07953af605b4918e268272de15ac151aa Mon Sep 17 00:00:00 2001 From: srs5694 Date: Fri, 19 Feb 2010 17:19:55 -0500 Subject: Version 0.6.4 --- bsd.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bsd.cc') diff --git a/bsd.cc b/bsd.cc index 5077555..c3ecadf 100644 --- a/bsd.cc +++ b/bsd.cc @@ -10,7 +10,7 @@ #define __STDC_CONSTANT_MACROS #include -#include +//#include #include #include #include @@ -37,7 +37,8 @@ BSDData::BSDData(void) { } // default constructor BSDData::~BSDData(void) { - delete[] partitions; + if (partitions != NULL) + delete[] partitions; } // destructor // Read BSD disklabel data from the specified device filename. This function @@ -64,9 +65,10 @@ int BSDData::ReadBSDData(const string & device, uint64_t startSector, uint64_t e // Load the BSD disklabel data from an already-opened disk // file, starting with the specified sector number. int BSDData::ReadBSDData(DiskIO *theDisk, uint64_t startSector, uint64_t endSector) { - uint8_t buffer[4096]; // I/O buffer - int i, foundSig = 0, bigEnd = 0, allOK = 1; + int allOK = 1; + int i, foundSig = 0, bigEnd = 0; int relative = 0; // assume absolute partition sector numbering + uint8_t buffer[4096]; // I/O buffer uint32_t realSig; uint32_t* temp32; uint16_t* temp16; @@ -158,7 +160,7 @@ int BSDData::ReadBSDData(DiskIO *theDisk, uint64_t startSector, uint64_t endSect // detected above, apply a correction to all partition start sectors.... if (relative) { for (i = 0; i < numParts; i++) { - partitions[i].firstLBA += startSector; + partitions[i].firstLBA += (uint32_t) startSector; } // for } // if } // if signatures OK -- cgit v1.2.1