diff --git a/snappy_unittest.cc b/snappy_unittest.cc index 122be0c..e57b13d 100644 --- a/snappy_unittest.cc +++ b/snappy_unittest.cc @@ -568,7 +568,7 @@ TEST(Snappy, IOVecSourceEdgeCases) { // Validate that empty leading, trailing, and in-between iovecs are handled: // [] [] ['a'] [] ['b'] []. std::string data = "ab"; - char* buf = data.data(); + char* buf = const_cast(data.data()); size_t used_so_far = 0; static const int kLengths[] = {0, 0, 1, 0, 1, 0}; struct iovec iov[ARRAYSIZE(kLengths)];