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:
LaurentGom 2010-02-23 07:28:46 +00:00
parent 646f7a31e6
commit 341b499180

View File

@ -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();
}
}