From 030600ac07ac96894886b9aa653f8ce25f3eba94 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Mon, 27 Dec 2010 22:06:01 +0000 Subject: [PATCH] Minor improvement in sf::Err's default streambuf git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1765 4e206d99-4929-0410-ac5d-dfc041789085 --- src/SFML/System/Err.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/SFML/System/Err.cpp b/src/SFML/System/Err.cpp index ec1ff75df..16f259904 100644 --- a/src/SFML/System/Err.cpp +++ b/src/SFML/System/Err.cpp @@ -85,12 +85,9 @@ private : // Check if there is something into the write buffer if (pbase() != pptr()) { - // Retrieve the contents of the write buffer - int size = static_cast(pptr() - pbase()); - std::string buffer(pbase(), size); - - // Write it into the standard error output - fprintf(stderr, "%s", buffer.c_str()); + // Print the contents of the write buffer into the standard error output + std::size_t size = static_cast(pptr() - pbase()); + fwrite(pbase(), 1, size, stderr); // Reset the pointer position to the beginning of the write buffer setp(pbase(), epptr());