Fix undefined behaviour - we were referring to two different temporaries.

This commit is contained in:
Daniel Patterson 2016-11-14 18:00:29 -08:00
parent 2dfeb0cabc
commit 9e2782d923

View File

@ -485,10 +485,10 @@ void Storage::LoadData(DataLayout *layout_ptr, char *memory_ptr)
std::fill(file_index_path_ptr, std::fill(file_index_path_ptr,
file_index_path_ptr + layout_ptr->GetBlockSize(DataLayout::FILE_INDEX_PATH), file_index_path_ptr + layout_ptr->GetBlockSize(DataLayout::FILE_INDEX_PATH),
0); 0);
auto absolute_file_index_path = boost::filesystem::absolute(config.file_index_path); const auto absolute_file_index_path =
std::copy(absolute_file_index_path.string().begin(), boost::filesystem::absolute(config.file_index_path).string();
absolute_file_index_path.string().end(), std::copy(
file_index_path_ptr); absolute_file_index_path.begin(), absolute_file_index_path.end(), file_index_path_ptr);
} }
// Name data // Name data