Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Provide null-terminated C strings
std::string_view::data() does not guarantee null-terminated string.

Signed-off-by: David Abdurachmanov <[email protected]>
  • Loading branch information
davidlt committed May 26, 2017
commit 0276049f39bca378779da0d3d0d4c0e5ed15ddb6
4 changes: 2 additions & 2 deletions io/io/v7/src/TFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class TV6Storage: public ROOT::Experimental::Internal::TFileStorageInterface {
}

void WriteMemoryWithType(std::string_view name, const void* address, TClass* cl) final {
fOldFile->WriteObjectAny(address, cl, name.data());
fOldFile->WriteObjectAny(address, cl, std::string(name.data(), name.size()).c_str());
}
};
}
Expand Down Expand Up @@ -191,7 +191,7 @@ std::string ROOT::Experimental::TFile::SetCacheDir(std::string_view path) {
std::lock_guard<std::mutex> lock(GetCacheDirMutex());

std::string ret = ::TFile::GetCacheFileDir();
::TFile::SetCacheFileDir(path.data());
::TFile::SetCacheFileDir(std::string(path.data(), path.size()).c_str());
return ret;
}

Expand Down