mirror of
https://github.com/tihmstar/futurerestore.git
synced 2024-12-22 17:35:29 +00:00
workaround fread windows bug?
This commit is contained in:
parent
d0abb366ec
commit
63f0d95f2a
|
@ -688,11 +688,14 @@ void futurerestore::loadSep(const char *sepPath){
|
|||
reterror(-15, "failed to malloc memory for SEP\n");
|
||||
|
||||
size_t freadRet=0;
|
||||
if ((freadRet = fread(_client->sepfwdata, 1, _client->sepfwdatasize, fsep)) != _client->sepfwdatasize)
|
||||
#ifdef WIN32
|
||||
printf("WARNING (WIN32) issue? _client->sepfwdatasize=%d but fread returned=%d\n",_client->sepfwdatasize,freadRet),
|
||||
#endif
|
||||
reterror(-15, "failed to load SEP\n");
|
||||
//workaroung for windows bug!?!?
|
||||
do {
|
||||
size_t cread = fread(_client->sepfwdata, 1, _client->sepfwdatasize, fsep);
|
||||
if (!cread)
|
||||
reterror(-15, "failed to load SEP. _client->sepfwdatasize=%zu but fread returned=%zu\n",_client->sepfwdatasize,freadRet);
|
||||
freadRet += cread;
|
||||
printf("reading sep %zu of %zu bytes",freadRet,_client->sepfwdatasize);
|
||||
} while (freadRet < _client->sepfwdatasize);
|
||||
|
||||
fclose(fsep);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue