Ticket #6827: restrict_impl2.patch
File restrict_impl2.patch, 1.1 KB (added by , 10 years ago) |
---|
-
M:\boost-dev\boost\iostreams\detail\
old new 141 141 template<typename Source> 142 142 std::streamsize read(Source& src, char_type* s, std::streamsize n) 143 143 { 144 144 using namespace std; 145 145 if (!open_) 146 146 open(src, BOOST_IOS::in); 147 std::streamsize amt = 148 end_ != -1 ? 149 (std::min) (n, static_cast<std::streamsize>(end_ - pos_)) : 150 n; 147 148 std::streamsize amt(n); 149 150 if (end_ != -1) 151 { 152 boost::iostreams::stream_offset remaining(end_ - pos_); 153 154 if (remaining <= std::numeric_limits<std::streamsize>::max()) 155 amt = (std::min)(n, static_cast<std::streamsize>(remaining)); 156 } 157 151 158 std::streamsize result = 152 159 iostreams::read(this->component(), src, s, amt); 153 160 if (result != -1) 154 161 pos_ += result; 155 162 return result; 156 163 }