diff --git a/src/CallRPC.cpp b/src/CallRPC.cpp index 50896b858..a8337198e 100644 --- a/src/CallRPC.cpp +++ b/src/CallRPC.cpp @@ -36,7 +36,7 @@ std::string EncodeBase64(const std::string& s) BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); bmem = BIO_new(BIO_s_mem()); b64 = BIO_push(b64, bmem); - BIO_write(b64, s.c_str(), s.size()); + BIO_write(b64, s.data(), s.size()); (void) BIO_flush(b64); BIO_get_mem_ptr(b64, &bptr); diff --git a/src/DeterministicKeys.cpp b/src/DeterministicKeys.cpp index 1f1e1a0c9..622c98598 100644 --- a/src/DeterministicKeys.cpp +++ b/src/DeterministicKeys.cpp @@ -19,7 +19,7 @@ uint128 CKey::PassPhraseToKey(const std::string& passPhrase) { Serializer s; - s.addRaw(passPhrase.c_str(), passPhrase.size()); + s.addRaw(passPhrase); uint256 hash256 = s.getSHA512Half(); uint128 ret(hash256); diff --git a/src/RPCHandler.cpp b/src/RPCHandler.cpp index 36fcfdffd..dbb6eb542 100644 --- a/src/RPCHandler.cpp +++ b/src/RPCHandler.cpp @@ -411,7 +411,7 @@ Json::Value RPCHandler::doAccountEmailSet(const Json::Value ¶ms) boost::to_lower(strEmail); std::vector vucMD5(128/8, 0); - MD5(reinterpret_cast(strEmail.c_str()), strEmail.size(), &vucMD5.front()); + MD5(reinterpret_cast(strEmail.data()), strEmail.size(), &vucMD5.front()); uint128 uEmailHash(vucMD5); std::vector vucDomain; diff --git a/src/rpc.cpp b/src/rpc.cpp index 15f53061c..2beec4c66 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -189,7 +189,7 @@ std::string DecodeBase64(std::string s) b64 = BIO_new(BIO_f_base64()); BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); - bmem = BIO_new_mem_buf(const_cast(s.c_str()), s.size()); + bmem = BIO_new_mem_buf(const_cast(s.data()), s.size()); bmem = BIO_push(b64, bmem); BIO_read(bmem, buffer, s.size()); BIO_free_all(bmem);