fwrite: fixed handling of already buffered data.
This commit is contained in:
parent
a05e448d90
commit
95de1f8365
|
@ -2152,7 +2152,7 @@ MSVCRT_size_t MSVCRT_fwrite(const void *ptr, MSVCRT_size_t size, MSVCRT_size_t n
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
return 0;
|
return 0;
|
||||||
if(file->_cnt) {
|
if(file->_cnt) {
|
||||||
int pcnt=(file->_cnt>wrcnt)? file->_cnt: wrcnt;
|
int pcnt=(file->_cnt>wrcnt)? wrcnt: file->_cnt;
|
||||||
memcpy(file->_ptr, ptr, pcnt);
|
memcpy(file->_ptr, ptr, pcnt);
|
||||||
file->_cnt -= pcnt;
|
file->_cnt -= pcnt;
|
||||||
file->_ptr += pcnt;
|
file->_ptr += pcnt;
|
||||||
|
|
Loading…
Reference in New Issue