From 4297a7abf3af580e48b789a398b23c8da91fa448 Mon Sep 17 00:00:00 2001 From: Nikita Zimin Date: Fri, 10 May 2024 18:07:07 +0300 Subject: [PATCH] WIP fixes (3) --- BKImgFile.cpp | 2 +- imgos/BKFloppyImage_Prototype.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BKImgFile.cpp b/BKImgFile.cpp index 2099a7e..77fd2be 100644 --- a/BKImgFile.cpp +++ b/BKImgFile.cpp @@ -246,7 +246,7 @@ std::wstring CBKImgFile::CalcImageSHA1() if (!m_f) return L""; - const size_t bufferSizeInBlocks = 16; + const size_t bufferSizeInBlocks = 32; const size_t bufferSizeInBytes = BLOCK_SIZE * bufferSizeInBlocks; long sizeTotal = GetFileSize(); diff --git a/imgos/BKFloppyImage_Prototype.cpp b/imgos/BKFloppyImage_Prototype.cpp index 2426398..795b16c 100644 --- a/imgos/BKFloppyImage_Prototype.cpp +++ b/imgos/BKFloppyImage_Prototype.cpp @@ -166,7 +166,7 @@ std::wstring CBKFloppyImage_Prototype::CalcFileSHA1(BKDirDataItem *fr) if (fr == nullptr || (fr->nAttr & (FR_ATTR::DIR | FR_ATTR::LINK)) != 0) return L""; - std::vector vec(fr->nSize); + std::vector vec(EvenSizeByBlock(fr->nSize)); if (!ReadFile(fr, vec.data())) { //TODO: Показать ошибку