Switch nSize to size_t
authorsvost <svost@users.noreply.github.com>
Sun, 13 Mar 2016 20:11:27 +0000 (23:11 +0300)
committersvost <svost@users.noreply.github.com>
Sun, 13 Mar 2016 20:11:27 +0000 (23:11 +0300)
Based on:
EC_POINT_point2oct return size_t
void resize (size_type n, value_type val = value_type());

src/key.cpp

index 2232324..546d95f 100644 (file)
@@ -612,7 +612,7 @@ bool CPoint::setPubKey(const CPubKey &vchPubKey)
 // Serialize to octets stream
 bool CPoint::getBytes(std::vector<unsigned char> &vchBytes)
 {
-    unsigned int nSize = EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, NULL, 0, ctx);
+    size_t nSize = EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, NULL, 0, ctx);
     vchBytes.resize(nSize);
     if (!(nSize == EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, &vchBytes[0], nSize, ctx))) {
         return false;
@@ -1243,4 +1243,4 @@ void CKey::DecryptData(const std::vector<unsigned char>& encrypted, std::vector<
     data.resize(length);
     memcpy(&data[0], decrypted, length);
     free(decrypted);
-}
\ No newline at end of file
+}