Skip to content

Commit 96f2119

Browse files
committed
Fix subscript[0] in compressor.cpp
1 parent 500710b commit 96f2119

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/compressor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,30 +93,30 @@ bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector<unsigne
9393
script[0] = OP_DUP;
9494
script[1] = OP_HASH160;
9595
script[2] = 20;
96-
memcpy(&script[3], &in[0], 20);
96+
memcpy(&script[3], in.data(), 20);
9797
script[23] = OP_EQUALVERIFY;
9898
script[24] = OP_CHECKSIG;
9999
return true;
100100
case 0x01:
101101
script.resize(23);
102102
script[0] = OP_HASH160;
103103
script[1] = 20;
104-
memcpy(&script[2], &in[0], 20);
104+
memcpy(&script[2], in.data(), 20);
105105
script[22] = OP_EQUAL;
106106
return true;
107107
case 0x02:
108108
case 0x03:
109109
script.resize(35);
110110
script[0] = 33;
111111
script[1] = nSize;
112-
memcpy(&script[2], &in[0], 32);
112+
memcpy(&script[2], in.data(), 32);
113113
script[34] = OP_CHECKSIG;
114114
return true;
115115
case 0x04:
116116
case 0x05:
117117
unsigned char vch[33] = {};
118118
vch[0] = nSize - 2;
119-
memcpy(&vch[1], &in[0], 32);
119+
memcpy(&vch[1], in.data(), 32);
120120
CPubKey pubkey(&vch[0], &vch[33]);
121121
if (!pubkey.Decompress())
122122
return false;

0 commit comments

Comments
 (0)