From 535b7bc8395fa477cd04e1a88479a069fc50b006 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Mon, 11 Oct 2010 17:58:18 +0000 Subject: [PATCH] Fixed a bug in sf::Err (the default output for SFML error messages), it was ignoring random characters git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1578 4e206d99-4929-0410-ac5d-dfc041789085 --- src/SFML/System/Err.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/SFML/System/Err.cpp b/src/SFML/System/Err.cpp index 52df5246..ec1ff75d 100644 --- a/src/SFML/System/Err.cpp +++ b/src/SFML/System/Err.cpp @@ -67,9 +67,15 @@ private : // Valid character return sputc(static_cast(character)); } + else if (character != EOF) + { + // Not enough space in the buffer: synchronize output and try again + sync(); + return overflow(character); + } else { - // Invalid character, or not enough space in the buffer: synchronize output + // Invalid character: synchronize output return sync(); } }