Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
filebundle: fix fb_read - fread might return an error or 0
  • Loading branch information
perexg committed Mar 8, 2016
1 parent c5487b2 commit ab3ce18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/filebundle.c
Expand Up @@ -435,6 +435,8 @@ ssize_t fb_read ( fb_file *fp, void *buf, size_t count )
fp->pos += count;
} else if (fp->type == FB_DIRECT) {
count = fread(buf, 1, count, fp->d.cur);
if (count <= 0)
return -1;
fp->pos += count;
} else {
count = MIN(count, fp->b.root->f.size - fp->pos);
Expand Down

0 comments on commit ab3ce18

Please sign in to comment.