Fixed a serious bug with Std_File_Reader setting unbuffered mode
This commit is contained in:
parent
810d58b4fe
commit
44da1bda00
1 changed files with 2 additions and 0 deletions
|
@ -599,8 +599,10 @@ blargg_err_t Std_File_Reader::open( const char path [] )
|
|||
|
||||
void Std_File_Reader::make_unbuffered()
|
||||
{
|
||||
long offset = ftell( STATIC_CAST(FILE*, file_) );
|
||||
if ( setvbuf( STATIC_CAST(FILE*, file_), NULL, _IONBF, 0 ) )
|
||||
check( false ); // shouldn't fail, but OK if it does
|
||||
fseek( STATIC_CAST(FILE*, file_), offset, SEEK_SET );
|
||||
}
|
||||
|
||||
blargg_err_t Std_File_Reader::read_v( void* p, int s )
|
||||
|
|
Loading…
Reference in a new issue