Skip to content

Commit e19db7b

Browse files
committed
Fix subscript[0] in utilstrencodings.cpp
1 parent bc2e7fd commit e19db7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utilstrencodings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ std::vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)
228228
std::string DecodeBase64(const std::string& str)
229229
{
230230
std::vector<unsigned char> vchRet = DecodeBase64(str.c_str());
231-
return (vchRet.size() == 0) ? std::string() : std::string((const char*)&vchRet[0], vchRet.size());
231+
return (vchRet.size() == 0) ? std::string() : std::string((const char*)vchRet.data(), vchRet.size());
232232
}
233233

234234
std::string EncodeBase32(const unsigned char* pch, size_t len)
@@ -415,7 +415,7 @@ std::vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid)
415415
std::string DecodeBase32(const std::string& str)
416416
{
417417
std::vector<unsigned char> vchRet = DecodeBase32(str.c_str());
418-
return (vchRet.size() == 0) ? std::string() : std::string((const char*)&vchRet[0], vchRet.size());
418+
return (vchRet.size() == 0) ? std::string() : std::string((const char*) vchRet.data(), vchRet.size());
419419
}
420420

421421
static bool ParsePrechecks(const std::string& str)

0 commit comments

Comments
 (0)