From a751efcc6ee2b7fbc4ba4ff3b16b9732685ebc8f Mon Sep 17 00:00:00 2001 From: ayuanx Date: Fri, 11 Dec 2009 10:32:33 +0000 Subject: [PATCH] Trying to constrain the seek position when file is empty doesn't work out either, sorry. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4680 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp | 4 ++-- 1 file 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());