Skip to content

Commit ebee4b4

Browse files
committed
rollup merge of #21736: sfackler/bufread-capacity-fix
We don't care about how much space the allocation has, but the actual usable space in the buffer. r? @alexcrichton
2 parents f8b3d5c + 26276f4 commit ebee4b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/old_io/buffered.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<R: Reader> Buffer for BufferedReader<R> {
111111

112112
impl<R: Reader> Reader for BufferedReader<R> {
113113
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
114-
if self.pos == self.cap && buf.len() >= self.buf.capacity() {
114+
if self.pos == self.cap && buf.len() >= self.buf.len() {
115115
return self.inner.read(buf);
116116
}
117117
let nread = {

0 commit comments

Comments
 (0)