aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-10-09 16:40:36 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-10-09 16:41:06 +0200
commitda0478e6e5d93d13178d098209f4397730b94065 (patch)
tree023ff3382c2cb40df86fe1d133fad6b9d1d4a3c3
parentd473e6ddc55c5def795348a83211e470d04a5489 (diff)
parentc6a995e7e5e6ae37dc1684f6060038e96864e947 (diff)
Merge #10961: Improve readability of DecodeBase58Check(...)
c6a995e Improve readability of DecodeBase58Check(...) (practicalswift) Pull request description: Use the more readable form ... ```c++ &vchRet[vchRet.size() - 4] ``` ... instead of ... ```c++ &v.end()[-n] ``` Has the added benefit of eliminating a spurious static analyzer warning about improper use of negative values. Tree-SHA512: 5895310c189e9322082c28f34342ff9a6c238e2cae3f204521111c8a7981bc555af60b42de082c91608c1125dfc244a65c4faf929249a067a51435e2be74cb39
-rw-r--r--src/base58.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/base58.cpp b/src/base58.cpp
index c2cc5d979f..9d5a2f4964 100644
--- a/src/base58.cpp
+++ b/src/base58.cpp
@@ -139,7 +139,7 @@ bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)
}
// re-calculate the checksum, ensure it matches the included 4-byte checksum
uint256 hash = Hash(vchRet.begin(), vchRet.end() - 4);
- if (memcmp(&hash, &vchRet.end()[-4], 4) != 0) {
+ if (memcmp(&hash, &vchRet[vchRet.size() - 4], 4) != 0) {
vchRet.clear();
return false;
}