summaryrefslogtreecommitdiff
path: root/Source/cmCryptoHash.cxx
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-08-13 07:48:01 -0400
committerAnas Nashif <anas.nashif@intel.com>2013-08-13 07:48:01 -0400
commit297c63fa65327491a2b50e521b661c5835a19fe4 (patch)
treecf30d58014e240eb5e4417727d8f137cdbe75828 /Source/cmCryptoHash.cxx
parentef8aa19c33e83ff019595fd7f8fdc29c35c336a3 (diff)
downloadcmake-297c63fa65327491a2b50e521b661c5835a19fe4.tar.gz
cmake-297c63fa65327491a2b50e521b661c5835a19fe4.tar.bz2
cmake-297c63fa65327491a2b50e521b661c5835a19fe4.zip
Imported Upstream version 2.8.11.2upstream/2.8.11.2sandbox/pcoval/previous/upstream
Diffstat (limited to 'Source/cmCryptoHash.cxx')
-rw-r--r--Source/cmCryptoHash.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index a1505bd65..a4f6ac4b4 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -54,8 +54,8 @@ std::string cmCryptoHash::HashFile(const char* file)
this->Initialize();
// Should be efficient enough on most system:
- const int bufferSize = 4096;
- char buffer[bufferSize];
+ cm_sha2_uint64_t buffer[512];
+ char* buffer_c = reinterpret_cast<char*>(buffer);
unsigned char const* buffer_uc =
reinterpret_cast<unsigned char const*>(buffer);
// This copy loop is very sensitive on certain platforms with
@@ -65,7 +65,7 @@ std::string cmCryptoHash::HashFile(const char* file)
// error occurred. Therefore, the loop should be safe everywhere.
while(fin)
{
- fin.read(buffer, bufferSize);
+ fin.read(buffer_c, sizeof(buffer));
if(int gcount = static_cast<int>(fin.gcount()))
{
this->Append(buffer_uc, gcount);