if (file->buff_ind < file->buff_len)
{
count = file->buff_len - file->buff_ind;
+ count = ((fs_offset_t)buffersize > count) ? count : (fs_offset_t)buffersize;
+ done += count;
+ memcpy (buffer, &file->buff[file->buff_ind], count);
+ file->buff_ind += count;
- done += ((fs_offset_t)buffersize > count) ? count : (fs_offset_t)buffersize;
- memcpy (buffer, &file->buff[file->buff_ind], done);
- file->buff_ind += done;
-
- buffersize -= done;
+ buffersize -= count;
if (buffersize == 0)
return done;
}
*/
int FS_Getc (qfile_t* file)
{
- char c;
+ unsigned char c;
if (FS_Read (file, &c, 1) != 1)
return EOF;