mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
merge bitcoin#17280: Change occurences of c_str() used with size() to data()
This commit is contained in:
parent
8b11e135f7
commit
9427becdb1
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
CHKDF_HMAC_SHA256_L32::CHKDF_HMAC_SHA256_L32(const unsigned char* ikm, size_t ikmlen, const std::string& salt)
|
CHKDF_HMAC_SHA256_L32::CHKDF_HMAC_SHA256_L32(const unsigned char* ikm, size_t ikmlen, const std::string& salt)
|
||||||
{
|
{
|
||||||
CHMAC_SHA256((const unsigned char*)salt.c_str(), salt.size()).Write(ikm, ikmlen).Finalize(m_prk);
|
CHMAC_SHA256((const unsigned char*)salt.data(), salt.size()).Write(ikm, ikmlen).Finalize(m_prk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHKDF_HMAC_SHA256_L32::Expand32(const std::string& info, unsigned char hash[OUTPUT_SIZE])
|
void CHKDF_HMAC_SHA256_L32::Expand32(const std::string& info, unsigned char hash[OUTPUT_SIZE])
|
||||||
|
@ -132,10 +132,10 @@ std::string get_filesystem_error_message(const fs::filesystem_error& e)
|
|||||||
#else
|
#else
|
||||||
// Convert from Multi Byte to utf-16
|
// Convert from Multi Byte to utf-16
|
||||||
std::string mb_string(e.what());
|
std::string mb_string(e.what());
|
||||||
int size = MultiByteToWideChar(CP_ACP, 0, mb_string.c_str(), mb_string.size(), nullptr, 0);
|
int size = MultiByteToWideChar(CP_ACP, 0, mb_string.data(), mb_string.size(), nullptr, 0);
|
||||||
|
|
||||||
std::wstring utf16_string(size, L'\0');
|
std::wstring utf16_string(size, L'\0');
|
||||||
MultiByteToWideChar(CP_ACP, 0, mb_string.c_str(), mb_string.size(), &*utf16_string.begin(), size);
|
MultiByteToWideChar(CP_ACP, 0, mb_string.data(), mb_string.size(), &*utf16_string.begin(), size);
|
||||||
// Convert from utf-16 to utf-8
|
// Convert from utf-16 to utf-8
|
||||||
return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t>().to_bytes(utf16_string);
|
return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t>().to_bytes(utf16_string);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user