Skip to content

Commit

Permalink
fix #1265
Browse files Browse the repository at this point in the history
  • Loading branch information
Reputeless committed Oct 2, 2024
1 parent 28cce16 commit 27a88e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,15 @@ namespace s3d
{
if (not m_file.file.read(static_cast<char*>(dst.pointer), readBytes))
{
m_file.pos = m_file.file.tellg();

if (m_file.file.eof())
{
setPos(previousPos);
return readBytes;
}

LOG_FAIL(U"❌ BinaryReader `{0}`: ReadFile() failed"_fmt(m_info.fullPath));

setPos(previousPos);
return 0;
}
}
Expand Down Expand Up @@ -286,14 +287,15 @@ namespace s3d
{
if (not m_file.file.read(static_cast<char*>(dst.pointer), readBytes))
{
m_file.pos = m_file.file.tellg();

if (m_file.file.eof())
{
setPos(previousPos);
return readBytes;
}

LOG_FAIL(U"❌ BinaryReader `{0}`: ReadFile() failed"_fmt(m_info.fullPath));

setPos(previousPos);
return 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,15 @@ namespace s3d
{
if (not m_file.file.read(static_cast<char*>(dst.pointer), readBytes))
{
m_file.pos = m_file.file.tellg();

if (m_file.file.eof())
{
setPos(previousPos);
return readBytes;
}

LOG_FAIL(U"❌ BinaryReader `{0}`: ReadFile() failed"_fmt(m_info.fullPath));

setPos(previousPos);
return 0;
}
}
Expand All @@ -192,14 +193,15 @@ namespace s3d
{
if (not m_file.file.read(static_cast<char*>(dst.pointer), readBytes))
{
m_file.pos = m_file.file.tellg();

if (m_file.file.eof())
{
setPos(previousPos);
return readBytes;
}

LOG_FAIL(U"❌ BinaryReader `{0}`: ReadFile() failed"_fmt(m_info.fullPath));

setPos(previousPos);
return 0;
}
}
Expand Down

0 comments on commit 27a88e6

Please sign in to comment.