summaryrefslogtreecommitdiff
path: root/src/streambuf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/streambuf.cpp')
-rw-r--r--src/streambuf.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/streambuf.cpp b/src/streambuf.cpp
index d4b4680..e258b4e 100644
--- a/src/streambuf.cpp
+++ b/src/streambuf.cpp
@@ -34,6 +34,9 @@ StreamBuf::StreamBuf(int error) : _error(error)
*/
int StreamBuf::overflow(int c)
{
+ // for error buffers, overflow is simply discarded
+ if (_error) return c;
+
// end-of-file has not output, we call EOF directly, and by using the
// comma operator we ensure that EOF is returned
if (c == EOF) return sync(), EOF;