From 87de88ccc570b98040a356a411ed6a47f58a4d72 Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Wed, 26 May 2010 17:12:20 -0400 Subject: Implemented NOR data request, it's ugly but it works! Successfully restored 4.0b4 to my device --- src/ipsw.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/ipsw.c') diff --git a/src/ipsw.c b/src/ipsw.c index f602d16..ca28596 100644 --- a/src/ipsw.c +++ b/src/ipsw.c @@ -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); -- cgit v1.1-32-gdbae