summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ipsw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index bd02bf9..d1d858b 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -231,10 +231,14 @@ int ipsw_extract_to_file_with_progress(const char* ipsw, const char* infile, con
ret = -1;
goto leave;
} else {
+ actual_outfile[0] = '\0';
if (realpath(outfile, actual_outfile) && (strcmp(actual_filepath, actual_outfile) == 0)) {
/* files are identical */
ret = 0;
} else {
+ if (actual_outfile[0] == '\0') {
+ strcpy(actual_outfile, outfile);
+ }
FILE *fi = fopen(actual_filepath, "rb");
if (!fi) {
error("ERROR: fopen: %s: %s\n", actual_filepath, strerror(errno));