http://llvm.org/bugs/show_bug.cgi?id=15427
Bug ID: 15427
Summary: basic_istream::read(s, n) should use sgetn(s, n)
rather than calling sbumpc() for each character.
Product: libc++
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
basic_istream::read(s, n) should call basic_streambuf's sgetn(s, n) as
basic_ostream::write(s, n) calling sputn(s, n).
in basic_istream::read(char_type* __s, streamsize __n)
- for (; __gc_ < __n; ++__gc_)
- {
- typename traits_type::int_type __i = this->rdbuf()->sbumpc();
- if (traits_type::eq_int_type(__i, traits_type::eof()))
- {
- this->setstate(ios_base::failbit | ios_base::eofbit);
- break;
- }
- *__s++ = traits_type::to_char_type(__i);
- }
+ __gc_ = this->rdbuf()->sgetn(__s, __n);
+ if (__gc_ != __n)
+ this->setstate(ios_base::failbit | ios_base::eofbit);
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs