summaryrefslogtreecommitdiffstats
path: root/src/ipsw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipsw.c')
-rw-r--r--src/ipsw.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index 9eeaab1..c833942 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -467,10 +467,8 @@ int ipsw_extract_to_file_with_progress(ipsw_archive_t ipsw, const char* infile,
size = i;
count = zip_fread(zfile, buffer, size);
if (count < 0) {
- int zep = 0;
- int sep = 0;
- zip_file_error_get(zfile, &zep, &sep);
- logger(LL_ERROR, "zip_fread: %s %d %d\n", infile, zep, sep);
+ zip_error_t *zerr = zip_file_get_error(zfile);
+ logger(LL_ERROR, "zip_fread: %s %d %d\n", infile, zip_error_code_zip(zerr), zip_error_code_system(zerr));
ret = -1;
break;
}
@@ -683,16 +681,15 @@ int ipsw_extract_to_memory(ipsw_archive_t ipsw, const char* infile, void** pbuff
}
zip_int64_t zr = zip_fread(zfile, buffer, size);
- int zep = 0;
- int sep = 0;
+ zip_error_t *zerr = NULL;
if (zr < 0) {
- zip_file_error_get(zfile, &zep, &sep);
+ zerr = zip_file_get_error(zfile);
}
zip_fclose(zfile);
zip_unchange_all(zip);
zip_close(zip);
if (zr < 0) {
- logger(LL_ERROR, "zip_fread: %s %d %d\n", infile, zep, sep);
+ logger(LL_ERROR, "zip_fread: %s %d %d\n", infile, zip_error_code_zip(zerr), zip_error_code_system(zerr));
free(buffer);
return -1;
} else if (zr != size) {
@@ -1302,7 +1299,7 @@ static int sha1_verify_fp(FILE* f, unsigned char* expected_sha1)
int ipsw_download_fw(const char *fwurl, unsigned char* isha1, const char* todir, char** ipswfile)
{
- char* fwfn = strrchr(fwurl, '/');
+ const char* fwfn = strrchr(fwurl, '/');
if (!fwfn) {
logger(LL_ERROR, "can't get local filename for firmware ipsw\n");
return -2;