Skip to content

Commit

Permalink
Merge pull request #5 from bvinc83/master
Browse files Browse the repository at this point in the history
Don't try to fill up the entire buffer on a read.
  • Loading branch information
bozaro committed Oct 15, 2015
2 parents 744c81b + f517177 commit 1ae80c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ impl<R: Read> Decoder<R> {
impl<R: Read> Read for Decoder<R> {
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
{
if self.eof
if self.eof || buf.len() == 0
{
return Ok(0);
}
let mut dst_offset: usize = 0;
while dst_offset < buf.len()
while dst_offset == 0
{
if self.pos >= self.len
{
Expand Down

0 comments on commit 1ae80c4

Please sign in to comment.