Skip to content

Commit

Permalink
[Fix] xmp-openmpt: Fix xmplay_streambuf::underflow(). When returning …
Browse files Browse the repository at this point in the history
…eof, we also need to set the get area to empty according to the standard.

git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@20365 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Mar 15, 2024
1 parent 2fe6c9f commit 2192d4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libopenmpt/xmp-openmpt/xmp-openmpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@ std::streambuf::int_type xmplay_streambuf::underflow() {
start += put_back_count;
}
std::size_t n = xmpffile->Read( file, start, buffer.size() - ( start - base ) );
setg( base, start, start + n );
if ( n == 0 ) {
return traits_type::eof();
}
setg( base, start, start + n );
return traits_type::to_int_type( *gptr() );
}

Expand Down

0 comments on commit 2192d4b

Please sign in to comment.