aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-02-12 11:41:00 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-02-12 11:41:12 +0100
commitc8b54b2044db2fafc561452afb44478a99fa83f3 (patch)
tree7b2e66f3bbca81c2047d7418a219d20cbf2777ad /src
parentb4d85490f09eab84497f7b352a6ca2b3f48de815 (diff)
parenta25cb0f313315bd987834aa5f500b5682a9c3cd5 (diff)
downloadbitcoin-c8b54b2044db2fafc561452afb44478a99fa83f3.tar.xz
Merge #12351: Libraries: Use correct type ; avoid compiler warnings.
a25cb0f Use ptrdiff_t type to more precisely indicate usage and avoid compiler warnings. (murrayn) Pull request description: ptrdiff_t is a more strictly correct type, and gets rid of compiler warnings. Tree-SHA512: 39718a5cdc10e698f14185f4622a9b439728bce619bd8b3a86f2b99ed5b056cf5a8545a3e5c4bc8a6a01b845fb73510036cee5e6d2629c58df26be692a957fba
Diffstat (limited to 'src')
-rw-r--r--src/key.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/key.cpp b/src/key.cpp
index e998e3db6e..ffed989be1 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -44,7 +44,7 @@ static int ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *ou
if (end - privkey < 1 || !(*privkey & 0x80u)) {
return 0;
}
- size_t lenb = *privkey & ~0x80u; privkey++;
+ ptrdiff_t lenb = *privkey & ~0x80u; privkey++;
if (lenb < 1 || lenb > 2) {
return 0;
}
@@ -52,7 +52,7 @@ static int ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *ou
return 0;
}
/* sequence length */
- size_t len = privkey[lenb-1] | (lenb > 1 ? privkey[lenb-2] << 8 : 0u);
+ ptrdiff_t len = privkey[lenb-1] | (lenb > 1 ? privkey[lenb-2] << 8 : 0u);
privkey += lenb;
if (end - privkey < len) {
return 0;
@@ -66,7 +66,7 @@ static int ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *ou
if (end - privkey < 2 || privkey[0] != 0x04u) {
return 0;
}
- size_t oslen = privkey[1];
+ ptrdiff_t oslen = privkey[1];
privkey += 2;
if (oslen > 32 || end - privkey < oslen) {
return 0;