Add data writing for IPaks

This commit is contained in:
Jan
2023-10-15 17:54:10 +02:00
parent 2d0ef40335
commit abbb697d7c
5 changed files with 157 additions and 18 deletions

View File

@ -70,8 +70,8 @@ class IPak::Impl : public ObjContainerReferenceable
{
IPakSection section{};
m_stream->read(reinterpret_cast<char*>(&section), sizeof section);
if (m_stream->gcount() != sizeof section)
m_stream->read(reinterpret_cast<char*>(&section), sizeof(section));
if (m_stream->gcount() != sizeof(section))
{
printf("Unexpected eof when trying to load section.\n");
return false;
@ -98,7 +98,7 @@ class IPak::Impl : public ObjContainerReferenceable
{
IPakHeader header{};
m_stream->read(reinterpret_cast<char*>(&header), sizeof header);
m_stream->read(reinterpret_cast<char*>(&header), sizeof(header));
if (m_stream->gcount() != sizeof header)
{
printf("Unexpected eof when trying to load header.\n");