mirror of
https://github.com/eosswedenorg/libantelope
synced 2026-08-24 12:48:11 +02:00
src/base58.cpp: fix integer size comparison warning.
This commit is contained in:
parent
fa7d3cb2e9
commit
000876176a
1 changed files with 2 additions and 2 deletions
|
|
@ -120,7 +120,7 @@ bool base58_decode(const char* psz, std::vector<unsigned char>& out) {
|
||||||
psz++;
|
psz++;
|
||||||
}
|
}
|
||||||
// Allocate enough space in big-endian base256 representation.
|
// 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<unsigned char> b256(size);
|
std::vector<unsigned char> b256(size);
|
||||||
// Process the characters.
|
// Process the characters.
|
||||||
|
|
||||||
|
|
@ -132,7 +132,7 @@ bool base58_decode(const char* psz, std::vector<unsigned char>& out) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (std::vector<unsigned char>::reverse_iterator it = b256.rbegin(); (carry != 0 || i < length) && (it != b256.rend()); ++it, ++i) {
|
for (std::vector<unsigned char>::reverse_iterator it = b256.rbegin(); (carry != 0 || i < length) && (it != b256.rend()); ++it, ++i) {
|
||||||
carry += 58 * (*it);
|
carry += 58 * (*it);
|
||||||
*it = carry % 256;
|
*it = (unsigned char) (carry % 256);
|
||||||
carry /= 256;
|
carry /= 256;
|
||||||
}
|
}
|
||||||
assert(carry == 0);
|
assert(carry == 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue