From 341b4991807a179aa518ea5177af6e16256859da Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Tue, 23 Feb 2010 07:28:46 +0000 Subject: [PATCH] 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 --- src/SFML/System/Err.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SFML/System/Err.cpp b/src/SFML/System/Err.cpp index ca042f43f..436cec65a 100644 --- a/src/SFML/System/Err.cpp +++ b/src/SFML/System/Err.cpp @@ -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(character)); } else { - // Invalid character: just synchronize output + // Invalid character, or not enough space in the buffer: synchronize output return sync(); } }