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
This commit is contained in:
LaurentGom 2010-12-27 22:06:01 +00:00
parent 87b207edc7
commit 030600ac07

View File

@ -85,12 +85,9 @@ private :
// Check if there is something into the write buffer // Check if there is something into the write buffer
if (pbase() != pptr()) if (pbase() != pptr())
{ {
// Retrieve the contents of the write buffer // Print the contents of the write buffer into the standard error output
int size = static_cast<int>(pptr() - pbase()); std::size_t size = static_cast<int>(pptr() - pbase());
std::string buffer(pbase(), size); fwrite(pbase(), 1, size, stderr);
// Write it into the standard error output
fprintf(stderr, "%s", buffer.c_str());
// Reset the pointer position to the beginning of the write buffer // Reset the pointer position to the beginning of the write buffer
setp(pbase(), epptr()); setp(pbase(), epptr());