Fix compilation errors under C++11.

`std::string::data()` is const-only until C++17.

PiperOrigin-RevId: 479708109
This commit is contained in:
Matt Callanan
2022-10-08 03:11:32 +02:00
committed by qrczak
parent d644ca8770
commit 974fcc49e8
3 changed files with 3 additions and 3 deletions

View File

@@ -170,7 +170,7 @@ struct iovec* GetIOVec(const std::string& input, char*& buf, size_t& num) {
int VerifyIOVecSource(const std::string& input) {
std::string compressed;
std::string copy = input;
char* buf = copy.data();
char* buf = const_cast<char*>(copy.data());
size_t num = 0;
struct iovec* iov = GetIOVec(input, buf, num);
const size_t written = snappy::CompressFromIOVec(iov, num, &compressed);