1
0
Fork 0

File seek out of range: move filepointer to end of file.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@692
This commit is contained in:
Ulf Wohlers 2003-02-24 17:59:38 +00:00
parent aa50a90a95
commit 75626ee0c3

View file

@ -336,6 +336,11 @@ bool localFile::Seek(Bit32u * pos,Bit32u type) {
}
fpos_t temppos;
int ret=fseek(fhandle,*pos,seektype);
if (ret!=0) {
// Out of file range, pretend everythings ok
// and move file pointer top end of file... ?! (Black Thorne)
fseek(fhandle,0,SEEK_END);
};
fgetpos(fhandle,&temppos);
//TODO Hope we don't encouter files with 64 bits size
Bit32u * fake_pos=(Bit32u*)&temppos;