diff --git a/src/base58.cpp b/src/base58.cpp index 3979dc1..bd2da9a 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -120,7 +120,7 @@ bool base58_decode(const char* psz, std::vector& out) { psz++; } // Allocate enough space in big-endian base256 representation. - int size = strlen(psz) * 733 /1000 + 1; // log(58) / log(256), rounded up. + std::size_t size = strlen(psz) * 733 /1000 + 1; // log(58) / log(256), rounded up. std::vector b256(size); // Process the characters. @@ -132,7 +132,7 @@ bool base58_decode(const char* psz, std::vector& out) { int i = 0; for (std::vector::reverse_iterator it = b256.rbegin(); (carry != 0 || i < length) && (it != b256.rend()); ++it, ++i) { carry += 58 * (*it); - *it = carry % 256; + *it = (unsigned char) (carry % 256); carry /= 256; } assert(carry == 0);