diff options
| -rw-r--r-- | tools/idevicebackup4.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/idevicebackup4.c b/tools/idevicebackup4.c index c4ee847..ef3fdd0 100644 --- a/tools/idevicebackup4.c +++ b/tools/idevicebackup4.c | |||
| @@ -1056,7 +1056,7 @@ static int handle_receive_files(plist_t message, const char *backup_dir) | |||
| 1056 | 1056 | ||
| 1057 | remove(bname); | 1057 | remove(bname); |
| 1058 | f = fopen(bname, "wb"); | 1058 | f = fopen(bname, "wb"); |
| 1059 | while (code == CODE_FILE_DATA) { | 1059 | while (f && (code == CODE_FILE_DATA)) { |
| 1060 | blocksize = nlen-1; | 1060 | blocksize = nlen-1; |
| 1061 | bdone = 0; | 1061 | bdone = 0; |
| 1062 | rlen = 0; | 1062 | rlen = 0; |
| @@ -1090,9 +1090,12 @@ static int handle_receive_files(plist_t message, const char *backup_dir) | |||
| 1090 | break; | 1090 | break; |
| 1091 | } | 1091 | } |
| 1092 | } | 1092 | } |
| 1093 | fclose(f); | 1093 | if (f) { |
| 1094 | 1094 | fclose(f); | |
| 1095 | file_count++; | 1095 | file_count++; |
| 1096 | } else { | ||
| 1097 | printf("Error opening '%s' for writing: %s\n", bname, strerror(errno)); | ||
| 1098 | } | ||
| 1096 | if (backup_total_size > 0) | 1099 | if (backup_total_size > 0) |
| 1097 | print_progress(backup_real_size, backup_total_size); | 1100 | print_progress(backup_real_size, backup_total_size); |
| 1098 | if (nlen == 0) { | 1101 | if (nlen == 0) { |
