Merge pull request #153 from crypto-ape/fix_for_msvc_broken_static_evaluation_in_array_declaration

Fix Compilation with MSVC
This commit is contained in:
Peter Conrad 2019-08-30 18:04:17 +02:00 committed by GitHub
commit 9e81e1d5b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -229,7 +229,7 @@ namespace fc { namespace ecc {
static std::string _to_base58( const extended_key_data& key )
{
char buffer[key.size() + 4]; // it's a small static array => allocate on stack
char buffer[std::tuple_size<extended_key_data>::value + 4]; // it's a small static array => allocate on stack
memcpy( buffer, key.data(), key.size() );
fc::sha256 double_hash = fc::sha256::hash( fc::sha256::hash( (char*)key.data(), key.size() ));
memcpy( buffer + key.size(), double_hash.data(), 4 );