1
0
Fork 0
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:
Nicolas Pennequin 2007-11-08 18:27:19 +00:00
parent 941600f121
commit b50473ffd8

View file

@ -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);
if (avail == 0 && h->filerem == 0)
{
/* File is finished reading */
return 0;
*size = 0;
return h;
}
if (*size == 0 || *size > avail + h->filerem)
*size = avail + h->filerem;