mirror of
https://github.com/tihmstar/futurerestore.git
synced 2025-01-02 19:25:31 +00:00
changed fopen to "rb" instead of "r". should fix load sep failed bug
This commit is contained in:
parent
9e61f9bf3f
commit
77735fc932
|
@ -681,7 +681,7 @@ void futurerestore::setBasebandManifestPath(const char *basebandManifestPath){
|
|||
};
|
||||
|
||||
void futurerestore::loadSep(const char *sepPath){
|
||||
FILE *fsep = fopen(sepPath, "r");
|
||||
FILE *fsep = fopen(sepPath, "rb");
|
||||
if (!fsep)
|
||||
reterror(-15, "failed to read SEP\n");
|
||||
|
||||
|
@ -693,21 +693,15 @@ void futurerestore::loadSep(const char *sepPath){
|
|||
reterror(-15, "failed to malloc memory for SEP\n");
|
||||
|
||||
size_t freadRet=0;
|
||||
//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);
|
||||
if ((freadRet = fread(_client->sepfwdata, 1, _client->sepfwdatasize, fsep)) != _client->sepfwdatasize)
|
||||
reterror(-15, "failed to load SEP. size=%zu but fread returned %zu\n",_client->sepfwdatasize,freadRet);
|
||||
|
||||
fclose(fsep);
|
||||
}
|
||||
|
||||
|
||||
void futurerestore::setBasebandPath(const char *basebandPath){
|
||||
FILE *fbb = fopen(basebandPath, "r");
|
||||
FILE *fbb = fopen(basebandPath, "rb");
|
||||
if (!fbb)
|
||||
reterror(-15, "failed to read Baseband");
|
||||
_basebandPath = basebandPath;
|
||||
|
|
Loading…
Reference in a new issue