aboutsummaryrefslogtreecommitdiff
path: root/src/key.cpp
diff options
context:
space:
mode:
authorJack Grigg <jack@z.cash>2017-06-06 20:28:37 +1200
committerJack Grigg <jack@z.cash>2017-07-17 11:57:23 -0500
commit48abe78e51e9a51fba8b93ff7faa32a14a2aa50c (patch)
treeac8497724d34fa0bfeb8996d1aafa714ed167cdc /src/key.cpp
parent17fa3913ef7ba5f569ebc3695fab15b10dd914f0 (diff)
Remove redundant `= 0` initialisations
Diffstat (limited to 'src/key.cpp')
-rw-r--r--src/key.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/key.cpp b/src/key.cpp
index 3b679414d1..3a93187d76 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -35,8 +35,6 @@ static secp256k1_context* secp256k1_context_sign = NULL;
*/
static int ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
const unsigned char *end = privkey + privkeylen;
- size_t lenb = 0;
- size_t len = 0;
memset(out32, 0, 32);
/* sequence header */
if (end - privkey < 1 || *privkey != 0x30u) {
@@ -47,7 +45,7 @@ static int ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *ou
if (end - privkey < 1 || !(*privkey & 0x80u)) {
return 0;
}
- lenb = *privkey & ~0x80u; privkey++;
+ size_t lenb = *privkey & ~0x80u; privkey++;
if (lenb < 1 || lenb > 2) {
return 0;
}
@@ -55,7 +53,7 @@ static int ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *ou
return 0;
}
/* sequence length */
- len = privkey[lenb-1] | (lenb > 1 ? privkey[lenb-2] << 8 : 0u);
+ size_t len = privkey[lenb-1] | (lenb > 1 ? privkey[lenb-2] << 8 : 0u);
privkey += lenb;
if (end - privkey < len) {
return 0;