summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
index 8d58a152cc..5509f280bb 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
@@ -153,9 +153,9 @@ CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
// AyuanX: this is still dubious because m_FileLength
// isn't updated on the fly when write happens
u32 NewSeekPosition = SeekPosition;
- if (SeekPosition > m_FileLength && Mode == 0)
+ if (m_FileLength > 0 && SeekPosition > m_FileLength && Mode == 0)
{
- NewSeekPosition = (m_FileLength) ? SeekPosition % m_FileLength : 0;
+ NewSeekPosition = SeekPosition % m_FileLength;
}
INFO_LOG(WII_IPC_FILEIO, "FileIO: New Seek Pos: 0x%08x, Mode: %i (%s)", NewSeekPosition, Mode, m_Name.c_str());