dont crash when you can't open a scanned fat file

This commit is contained in:
zeromus 2010-09-03 11:34:58 +00:00
parent b1891e35a9
commit cf5ba963c0
1 changed files with 14 additions and 11 deletions

View File

@ -357,6 +357,8 @@ void build_ListCallback(FsEntry* fs, EListCallbackArg arg)
std::string path = currPath + std::string(1,FS_SEPARATOR) + fname;
FILE* inf = fopen(path.c_str(),"rb");
if(inf)
{
fseek(inf,0,SEEK_END);
long len = ftell(inf);
fseek(inf,0,SEEK_SET);
@ -370,6 +372,7 @@ void build_ListCallback(FsEntry* fs, EListCallbackArg arg)
f.close();
delete[] buf;
}
}
}