summaryrefslogtreecommitdiffstats
path: root/src/asr.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-02-14 01:33:35 +0100
committerGravatar Nikias Bassen2019-02-14 01:33:35 +0100
commit71cc441b9e742c135b19bda941f384bcaf052112 (patch)
tree0883e54b4c7c732c2058829d4d3801426f5b9ce9 /src/asr.c
parent15b85554808e51d3009f3742b1800620a217b149 (diff)
downloadidevicerestore-71cc441b9e742c135b19bda941f384bcaf052112.tar.gz
idevicerestore-71cc441b9e742c135b19bda941f384bcaf052112.tar.bz2
win32: Workaround for _lseeki64 not seeking as expected...
NO COMMENT
Diffstat (limited to 'src/asr.c')
-rw-r--r--src/asr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/asr.c b/src/asr.c
index 3800c2b..22192fe 100644
--- a/src/asr.c
+++ b/src/asr.c
@@ -207,6 +207,7 @@ int asr_perform_validation(asr_client_t asr, const char* filesystem) {
#ifdef WIN32
length = _lseeki64(fileno(file), 0, SEEK_END);
_lseeki64(fileno(file), 0, SEEK_SET);
+ rewind(file);
#else
fseeko(file, 0, SEEK_END);
length = ftello(file);
@@ -306,6 +307,7 @@ int asr_handle_oob_data_request(asr_client_t asr, plist_t packet, FILE* file) {
}
#ifdef WIN32
+ rewind(file);
_lseeki64(fileno(file), oob_offset, SEEK_SET);
#else
fseeko(file, oob_offset, SEEK_SET);
@@ -342,6 +344,7 @@ int asr_send_payload(asr_client_t asr, const char* filesystem) {
#ifdef WIN32
length = _lseeki64(fileno(file), 0, SEEK_END);
_lseeki64(fileno(file), 0, SEEK_SET);
+ rewind(file);
#else
fseeko(file, 0, SEEK_END);
length = ftello(file);