diff options
| author | murrayn <[email protected]> | 2018-02-05 02:25:28 -0800 |
|---|---|---|
| committer | murrayn <[email protected]> | 2018-02-05 02:25:28 -0800 |
| commit | a25cb0f313315bd987834aa5f500b5682a9c3cd5 (patch) | |
| tree | 579e14e2f6820e60648a2240b664bbee9b1d8705 /src/key.cpp | |
| parent | Merge #12331: Docs: Properly alphabetize output of CLI --help option. (diff) | |
| download | discoin-a25cb0f313315bd987834aa5f500b5682a9c3cd5.tar.xz discoin-a25cb0f313315bd987834aa5f500b5682a9c3cd5.zip | |
Use ptrdiff_t type to more precisely indicate usage and avoid compiler warnings.
Diffstat (limited to 'src/key.cpp')
| -rw-r--r-- | src/key.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/key.cpp b/src/key.cpp index e998e3db6..ffed989be 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; |