read properties stream to size of properties object, not 1

This commit is contained in:
karenzshea
2016-10-21 13:52:27 -07:00
committed by Huyen Chau Nguyen
parent 51ebadfc45
commit c4f010e363
3 changed files with 6 additions and 6 deletions
@@ -124,7 +124,7 @@ class InternalDataFacade final : public BaseDataFacade
throw util::exception("Could not open " + properties_path.string() + " for reading.");
}
auto PropertiesSize = storage::io::readPropertiesSize();
storage::io::readProperties(in_stream, reinterpret_cast<char *>(&m_profile_properties), PropertiesSize);
storage::io::readProperties(in_stream, &m_profile_properties, PropertiesSize);
}
void LoadLaneTupleIdPairs(const boost::filesystem::path &lane_data_path)
+3 -3
View File
@@ -19,10 +19,10 @@ inline std::size_t readPropertiesSize() { return 1; }
template <typename PropertiesT>
inline void readProperties(boost::filesystem::ifstream &properties_stream,
PropertiesT properties[],
std::size_t PropertiesSize)
PropertiesT *properties,
std::size_t properties_size)
{
properties_stream.read(properties, PropertiesSize);
properties_stream.read(reinterpret_cast<char *>(properties), properties_size);
}
#pragma pack(push, 1)