From 037fe4780ef28e4a7b4c625ff6279e24d2b91b86 Mon Sep 17 00:00:00 2001 From: hama Date: Tue, 3 Mar 2015 00:51:22 +0100 Subject: [PATCH] fix ReDirChecksum --- base/ReSeqArray.cpp | 2 +- math/ReRPD64.cpp | 2 +- math/ReRPD64.hpp | 1 - os/ReDirTools.cpp | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/base/ReSeqArray.cpp b/base/ReSeqArray.cpp index 1f8df44..1e721ef 100644 --- a/base/ReSeqArray.cpp +++ b/base/ReSeqArray.cpp @@ -460,7 +460,7 @@ void ReSeqArray::set(Index index, const Byte* source, size_t sourceLength, if (currentLength >= sourceLength) { // Use the existing space: indexContent = seq->m_index; - memcpy(m_content.buffer() + indexContent, source, sourceLength); + memmove(m_content.buffer() + indexContent, source, sourceLength); m_lost += currentLength - sourceLength; } else { // New space must be allocated: diff --git a/math/ReRPD64.cpp b/math/ReRPD64.cpp index 19598b0..6d613b3 100644 --- a/math/ReRPD64.cpp +++ b/math/ReRPD64.cpp @@ -220,7 +220,7 @@ void ReRPD64::reset() { m_c0 = 0x242070dbffff5bb1ll; m_d0 = 0xc1bdceee895cd7bell; memset(m_digest, 0, sizeof m_digest); - memset(m_waiting, 0, sizeof m_waiting); + memset(m_waiting, 0, m_chunkSize * 2); m_lengthWaiting = 0; m_length = 0; m_hexDigest.setLength(0); diff --git a/math/ReRPD64.hpp b/math/ReRPD64.hpp index 8a4fa09..e237228 100644 --- a/math/ReRPD64.hpp +++ b/math/ReRPD64.hpp @@ -30,7 +30,6 @@ private: uint64_t m_b0; uint64_t m_c0; uint64_t m_d0; - uint64_t m_salt; }; #endif /* MATH_RERPD64_HPP_ */ diff --git a/os/ReDirTools.cpp b/os/ReDirTools.cpp index ca9c86e..89b64c6 100644 --- a/os/ReDirTools.cpp +++ b/os/ReDirTools.cpp @@ -1160,7 +1160,7 @@ void ReDirChecksum::compareDir(const char* path, ReStringList& names, const char* storageFile){ // forget the last line (checksum): int count = names.count() - 1; - names.remove(count - 1); + names.remove(count); for (int ii = 0; ii < count; ii++){ const char* name = names.strOf(ii); const char* ptr = strchr(name, '\t'); -- 2.39.5