mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Fixed endless recursion in the streambuf of sf::Err
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1420 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
646f7a31e6
commit
341b499180
@ -62,14 +62,14 @@ private :
|
||||
|
||||
virtual int overflow(int character)
|
||||
{
|
||||
if (character != EOF)
|
||||
if ((character != EOF) && (pptr() != epptr()))
|
||||
{
|
||||
// Valid character: add it to the write buffer (sync() will be called if the buffer is full)
|
||||
// Valid character
|
||||
return sputc(static_cast<char>(character));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Invalid character: just synchronize output
|
||||
// Invalid character, or not enough space in the buffer: synchronize output
|
||||
return sync();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user