diff options
author | 2010-05-26 17:12:20 -0400 | |
---|---|---|
committer | 2010-05-26 17:12:20 -0400 | |
commit | 87de88ccc570b98040a356a411ed6a47f58a4d72 (patch) | |
tree | e064d7d52ed21c194b5d095ff02b4c5d10a59d5c /src/ipsw.c | |
parent | 8e62479ecbcf29a60bd6a03a08a3487955367f2a (diff) | |
download | idevicerestore-87de88ccc570b98040a356a411ed6a47f58a4d72.tar.gz idevicerestore-87de88ccc570b98040a356a411ed6a47f58a4d72.tar.bz2 |
Implemented NOR data request, it's ugly but it works! Successfully restored 4.0b4 to my device
Diffstat (limited to 'src/ipsw.c')
-rw-r--r-- | src/ipsw.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -74,7 +74,7 @@ int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfi } char* buffer = (char*) malloc(BUFSIZE); - if(buffer == NULL) { + if (buffer == NULL) { error("ERROR: Unable to allocate memory\n"); return -1; } @@ -86,7 +86,7 @@ int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfi } FILE* fd = fopen(outfile, "wb"); - if(fd == NULL) { + if (fd == NULL) { error("ERROR: Unable to open output file: %s\n", outfile); zip_fclose(zfile); return -1; @@ -96,8 +96,10 @@ int ipsw_extract_to_file(const char* ipsw, const char* infile, const char* outfi int size = 0; int count = 0; for (i = zstat.size; i > 0; i -= count) { - if(i < BUFSIZE) size = i; - else size = BUFSIZE; + if (i < BUFSIZE) + size = i; + else + size = BUFSIZE; count = zip_fread(zfile, buffer, size); if (count < 0) { error("ERROR: zip_fread: %s\n", infile); |