summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-23 21:11:57 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-23 21:11:57 +0100
commit68441d448e377f9a61af5c29c793922fff0d9328 (patch)
tree6fc34379b4fc010751c4cd38ea0722f37f1cf085 /src
parentd8b25fe2e585634567483124a33c3b779d2516f5 (diff)
errors have a limited buffer, and discard any overflow data, replaced std::cout calls with Php::out calls in the documentation
Diffstat (limited to 'src')
-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;