Skip to content

Commit 26276f4

Browse files
committed
Fix up check to bypass internal buffer
We don't care about how much space the allocation has, but the actual usable space in the buffer.
1 parent c5961ad commit 26276f4

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)