diff --git a/diskimg/ProDOS.cpp b/diskimg/ProDOS.cpp index b848822..90d604d 100644 --- a/diskimg/ProDOS.cpp +++ b/diskimg/ProDOS.cpp @@ -4538,6 +4538,8 @@ DIError A2FDProDOS::Write(const void* buf, size_t len, size_t* pActual) bool allocSparse = (pDiskFS->GetParameter(DiskFS::kParmProDOS_AllocSparse) != 0); uint8_t blkBuf[kBlkSize]; uint16_t keyBlock; + bool allZero = true; + const uint8_t* scanPtr = (const uint8_t*)buf; if (len >= 0x01000000) { // 16MB assert(false); @@ -4578,8 +4580,6 @@ DIError A2FDProDOS::Write(const void* buf, size_t len, size_t* pActual) * where we store it as a seedling. (GS/OS seems to do this, ProDOS 8 * v2.0.3 tends to allocate the first block.) */ - bool allZero = true; - const uint8_t* scanPtr = (const uint8_t*)buf; for (unsigned int i = 0; i < len; ++i, ++scanPtr) { if (*scanPtr != 0x00) { allZero = false; diff --git a/diskimg/TwoImg.cpp b/diskimg/TwoImg.cpp index 9d21cb0..e42499a 100644 --- a/diskimg/TwoImg.cpp +++ b/diskimg/TwoImg.cpp @@ -30,7 +30,7 @@ int TwoImgHeader::InitHeader(int imageFormat, uint32_t imageSize, { if (imageSize == 0) return -1; - if (imageFormat < kImageFormatDOS || imageFormat > (int) kImageFormatNibble) + if (imageFormat < (int) kImageFormatDOS || imageFormat > (int) kImageFormatNibble) return -1; if (imageFormat != kImageFormatNibble &&