diff options
author | Jeremy Rubin <jeremy.l.rubin@gmail.com> | 2017-02-19 12:39:51 -0500 |
---|---|---|
committer | Jeremy Rubin <jeremy.l.rubin@gmail.com> | 2017-07-08 13:33:01 -0700 |
commit | 96f2119e6c391617f0c7f27ce5af44604a7af937 (patch) | |
tree | 6dece987bda0103dd3949e7cc45c908eca76d366 | |
parent | 500710bd291e0b9f269ef20677a4a849fb76fc06 (diff) |
Fix subscript[0] in compressor.cpp
-rw-r--r-- | src/compressor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compressor.cpp b/src/compressor.cpp index 20c154fc1e..f4c12f38d2 100644 --- a/src/compressor.cpp +++ b/src/compressor.cpp @@ -93,7 +93,7 @@ bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector<unsigne script[0] = OP_DUP; script[1] = OP_HASH160; script[2] = 20; - memcpy(&script[3], &in[0], 20); + memcpy(&script[3], in.data(), 20); script[23] = OP_EQUALVERIFY; script[24] = OP_CHECKSIG; return true; @@ -101,7 +101,7 @@ bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector<unsigne script.resize(23); script[0] = OP_HASH160; script[1] = 20; - memcpy(&script[2], &in[0], 20); + memcpy(&script[2], in.data(), 20); script[22] = OP_EQUAL; return true; case 0x02: @@ -109,14 +109,14 @@ bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector<unsigne script.resize(35); script[0] = 33; script[1] = nSize; - memcpy(&script[2], &in[0], 32); + memcpy(&script[2], in.data(), 32); script[34] = OP_CHECKSIG; return true; case 0x04: case 0x05: unsigned char vch[33] = {}; vch[0] = nSize - 2; - memcpy(&vch[1], &in[0], 32); + memcpy(&vch[1], in.data(), 32); CPubKey pubkey(&vch[0], &vch[33]); if (!pubkey.Decompress()) return false; |