diff options
author | theraven <theraven@FreeBSD.org> | 2013-02-07 15:45:28 +0000 |
---|---|---|
committer | theraven <theraven@FreeBSD.org> | 2013-02-07 15:45:28 +0000 |
commit | d19c702291ff3bd9e769a152e7db96e17f5167f7 (patch) | |
tree | 52637438fa031aa783147d9ac30dac90131dffdf /contrib/libc++/include/ostream | |
parent | 0ab90cb3f6b7aa6a5a725c5aadaee31d34eaca96 (diff) | |
download | FreeBSD-src-d19c702291ff3bd9e769a152e7db96e17f5167f7.zip FreeBSD-src-d19c702291ff3bd9e769a152e7db96e17f5167f7.tar.gz |
Import new libc++ to head. Various small fixes and cleanups.
MFC after: 2 weeks
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 } |