#23 file_fwrite incorrect coffset in v0.2.8

open
nobody
None
5
2011-01-31
2011-01-31
akhil
No

In the case when the offset given to file_fwrite is > FileSize, the offset is set to FileSize but coffset is still initialized to the old value of offset.
This is easily corrected by making the assignment coffset=offset after the following check instead of before.

if(offset>file->FileSize){
offset=file->FileSize;
}
coffset=offset;

Discussion