1
0
Fork 0
forked from len0rd/rockbox

Text viewer: Fix possible memory corruption

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25510 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomer Shalev 2010-04-07 17:06:32 +00:00
parent 1709d72eb4
commit eeb0c088fe

View file

@ -1011,7 +1011,7 @@ static void fill_buffer(long pos, unsigned char* buf, unsigned size)
if (offset == 0 && prefs.encoding == UTF_8 && is_bom)
rb->lseek(fd, BOM_SIZE, SEEK_SET);
numread = rb->read(fd, buf, size);
numread = rb->read(fd, buf, size - 1);
buf[numread] = 0;
rb->button_clear_queue(); /* clear button queue */