diff options
author | Victor Costan <costan@google.com> | 2022-09-29 09:46:03 -0700 |
---|---|---|
committer | Victor Costan <costan@google.com> | 2022-09-29 09:56:09 -0700 |
commit | a5054767929fb750adff8248c6dc719f1adb135c (patch) | |
tree | fe229afa2d3b496cb30ee913af2545e19d85ea36 /snappy_unittest.cc | |
parent | 9758c9dfd744f252bf3351c1a212e05c9f7fc857 (diff) | |
download | snappy-git-fix_build.tar.gz |
Test: fix build error.fix_build
Diffstat (limited to 'snappy_unittest.cc')
-rw-r--r-- | snappy_unittest.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/snappy_unittest.cc b/snappy_unittest.cc index aeb8044..005fa42 100644 --- a/snappy_unittest.cc +++ b/snappy_unittest.cc @@ -169,7 +169,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; + std::vector<char> copy(input.begin(), input.end()); char* buf = copy.data(); size_t num = 0; struct iovec* iov = GetIOVec(input, buf, num); @@ -567,8 +567,8 @@ TEST(Snappy, FourByteOffset) { 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 data[3] = "ab"; + char* buf = data; size_t used_so_far = 0; static const int kLengths[] = {0, 0, 1, 0, 1, 0}; struct iovec iov[ARRAYSIZE(kLengths)]; |