Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115643
D7387.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D7387.diff
View Options
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -442,7 +442,7 @@
if (!gArgs.GetArgs("-rpcwallet").empty()) {
std::string walletName = gArgs.GetArg("-rpcwallet", "");
char *encodedURI =
- evhttp_uriencode(walletName.c_str(), walletName.size(), false);
+ evhttp_uriencode(walletName.data(), walletName.size(), false);
if (encodedURI) {
endpoint = "/wallet/" + std::string(encodedURI);
free(encodedURI);
diff --git a/src/crypto/hkdf_sha256_32.cpp b/src/crypto/hkdf_sha256_32.cpp
--- a/src/crypto/hkdf_sha256_32.cpp
+++ b/src/crypto/hkdf_sha256_32.cpp
@@ -9,7 +9,7 @@
CHKDF_HMAC_SHA256_L32::CHKDF_HMAC_SHA256_L32(const uint8_t *ikm, size_t ikmlen,
const std::string &salt) {
- CHMAC_SHA256((const uint8_t *)salt.c_str(), salt.size())
+ CHMAC_SHA256((const uint8_t *)salt.data(), salt.size())
.Write(ikm, ikmlen)
.Finalize(m_prk);
}
diff --git a/src/fs.cpp b/src/fs.cpp
--- a/src/fs.cpp
+++ b/src/fs.cpp
@@ -125,11 +125,11 @@
#else
// Convert from Multi Byte to utf-16
std::string mb_string(e.what());
- int size = MultiByteToWideChar(CP_ACP, 0, mb_string.c_str(),
+ int size = MultiByteToWideChar(CP_ACP, 0, mb_string.data(),
mb_string.size(), nullptr, 0);
std::wstring utf16_string(size, L'\0');
- MultiByteToWideChar(CP_ACP, 0, mb_string.c_str(), mb_string.size(),
+ MultiByteToWideChar(CP_ACP, 0, mb_string.data(), mb_string.size(),
&*utf16_string.begin(), size);
// Convert from utf-16 to utf-8
return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t>()
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -123,9 +123,9 @@
static const unsigned int KEY_SIZE = 32;
uint8_t out[KEY_SIZE];
- CHMAC_SHA256(reinterpret_cast<const uint8_t *>(strSalt.c_str()),
+ CHMAC_SHA256(reinterpret_cast<const uint8_t *>(strSalt.data()),
strSalt.size())
- .Write(reinterpret_cast<const uint8_t *>(strPass.c_str()),
+ .Write(reinterpret_cast<const uint8_t *>(strPass.data()),
strPass.size())
.Finalize(out);
std::vector<uint8_t> hexvec(out, out + KEY_SIZE);
diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp
--- a/src/util/strencodings.cpp
+++ b/src/util/strencodings.cpp
@@ -149,7 +149,7 @@
}
std::string EncodeBase64(const std::string &str) {
- return EncodeBase64((const uint8_t *)str.c_str(), str.size());
+ return EncodeBase64((const uint8_t *)str.data(), str.size());
}
std::vector<uint8_t> DecodeBase64(const char *p, bool *pf_invalid) {
@@ -221,7 +221,7 @@
}
std::string EncodeBase32(const std::string &str) {
- return EncodeBase32((const uint8_t *)str.c_str(), str.size());
+ return EncodeBase32((const uint8_t *)str.data(), str.size());
}
std::vector<uint8_t> DecodeBase32(const char *p, bool *pf_invalid) {
diff --git a/src/wallet/crypter.cpp b/src/wallet/crypter.cpp
--- a/src/wallet/crypter.cpp
+++ b/src/wallet/crypter.cpp
@@ -24,7 +24,7 @@
uint8_t buf[CSHA512::OUTPUT_SIZE];
CSHA512 di;
- di.Write((const uint8_t *)strKeyData.c_str(), strKeyData.size());
+ di.Write((const uint8_t *)strKeyData.data(), strKeyData.size());
di.Write(chSalt.data(), chSalt.size());
di.Finalize(buf);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:38 (6 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187648
Default Alt Text
D7387.diff (3 KB)
Attached To
D7387: [backport#17280] refactor: Change occurences of c_str() used with size() to data()
Event Timeline
Log In to Comment