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");
|
reterror(-15, "failed to malloc memory for SEP\n");
|
||||||
|
|
||||||
size_t freadRet=0;
|
size_t freadRet=0;
|
||||||
if ((freadRet = fread(_client->sepfwdata, 1, _client->sepfwdatasize, fsep)) != _client->sepfwdatasize)
|
//workaroung for windows bug!?!?
|
||||||
#ifdef WIN32
|
do {
|
||||||
printf("WARNING (WIN32) issue? _client->sepfwdatasize=%d but fread returned=%d\n",_client->sepfwdatasize,freadRet),
|
size_t cread = fread(_client->sepfwdata, 1, _client->sepfwdatasize, fsep);
|
||||||
#endif
|
if (!cread)
|
||||||
reterror(-15, "failed to load SEP\n");
|
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);
|
fclose(fsep);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue