Use traits_type::to_int_type in basic_streambuf<_CharT, _Traits>::xsputn when calling overflow to correctly handle negative signed character types. This fixes http://llvm.org/bugs/show_bug.cgi?id=14074.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@165884 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant 2012-10-13 19:31:51 +00:00
parent 999fc97ef2
commit 1c0be3864a

View File

@ -540,7 +540,7 @@ basic_streambuf<_CharT, _Traits>::xsputn(const char_type* __s, streamsize __n)
{ {
if (__nout_ < __eout_) if (__nout_ < __eout_)
*__nout_++ = *__s; *__nout_++ = *__s;
else if (overflow(*__s) == __eof) else if (overflow(traits_type::to_int_type(*__s)) == __eof)
break; break;
} }
return __i; return __i;