diff options
Diffstat (limited to 'contrib/libc++/include/ostream')
-rw-r--r-- | contrib/libc++/include/ostream | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/contrib/libc++/include/ostream b/contrib/libc++/include/ostream index 9d26a41..b3b6df5 100644 --- a/contrib/libc++/include/ostream +++ b/contrib/libc++/include/ostream @@ -1100,17 +1100,8 @@ basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n) sentry __sen(*this); if (__sen && __n) { - typedef ostreambuf_iterator<_CharT, _Traits> _Op; - _Op __o(*this); - for (; __n; --__n, ++__o, ++__s) - { - *__o = *__s; - if (__o.failed()) - { - this->setstate(ios_base::badbit); - break; - } - } + if (this->rdbuf()->sputn(__s, __n) != __n) + this->setstate(ios_base::badbit); } #ifndef _LIBCPP_NO_EXCEPTIONS } |