msvcrt: fread: fill buffer on small reads
Alexandre Julliard
julliard at winehq.org
Tue Oct 10 09:36:56 CDT 2006
Markus Amsler <markus.amsler at oribi.org> writes:
>
> + /* fill empty buffer on small reads */
> + if(!file->_cnt && rcnt <= MSVCRT_BUFSIZ) {
> + MSVCRT__filbuf(file);
> + /* reset internal buffer */
> + file->_cnt++;
> + file->_ptr = file->_base;
> + }
You need to handle errors properly, and MSVCRT__filbuf is probably not
the most appropriate thing to use here, a simple read would be
better.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list