forked from len0rd/rockbox
Fix a bug introduced by r15533 where end-of-file wouldn't be detected correctly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15541 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
941600f121
commit
b50473ffd8
1 changed files with 4 additions and 1 deletions
|
|
@ -984,8 +984,11 @@ static struct memory_handle *prep_bufdata(int handle_id, size_t *size,
|
||||||
size_t avail = RINGBUF_SUB(h->widx, h->ridx);
|
size_t avail = RINGBUF_SUB(h->widx, h->ridx);
|
||||||
|
|
||||||
if (avail == 0 && h->filerem == 0)
|
if (avail == 0 && h->filerem == 0)
|
||||||
|
{
|
||||||
/* File is finished reading */
|
/* File is finished reading */
|
||||||
return 0;
|
*size = 0;
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
if (*size == 0 || *size > avail + h->filerem)
|
if (*size == 0 || *size > avail + h->filerem)
|
||||||
*size = avail + h->filerem;
|
*size = avail + h->filerem;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue