summaryrefslogtreecommitdiffstats
path: root/tools/iphonebackup.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/iphonebackup.c')
-rw-r--r--tools/iphonebackup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/iphonebackup.c b/tools/iphonebackup.c
index d444e9b..c0f2276 100644
--- a/tools/iphonebackup.c
+++ b/tools/iphonebackup.c
@@ -425,6 +425,7 @@ int main(int argc, char *argv[])
425 425
426 /* receive and save DLSendFile files and metadata, ACK each */ 426 /* receive and save DLSendFile files and metadata, ACK each */
427 int file_index = 0; 427 int file_index = 0;
428 int hunk_index = 0;
428 uint64_t backup_real_size = 0; 429 uint64_t backup_real_size = 0;
429 char *file_path = NULL; 430 char *file_path = NULL;
430 char *file_ext = NULL; 431 char *file_ext = NULL;
@@ -442,8 +443,8 @@ int main(int argc, char *argv[])
442 443
443 node_tmp = plist_array_get_item(message, 2); 444 node_tmp = plist_array_get_item(message, 2);
444 445
445 /* first message contains total backup size */ 446 /* first message hunk contains total backup size */
446 if (file_index == 0) { 447 if (hunk_index == 0) {
447 node = plist_dict_get_item(node_tmp, "BackupTotalSizeKey"); 448 node = plist_dict_get_item(node_tmp, "BackupTotalSizeKey");
448 if (node) { 449 if (node) {
449 plist_get_uint_val(node, &backup_total_size); 450 plist_get_uint_val(node, &backup_total_size);
@@ -533,6 +534,8 @@ int main(int argc, char *argv[])
533 printf("DONE\n"); 534 printf("DONE\n");
534 } 535 }
535 536
537 hunk_index++;
538
536 if (file_ext) 539 if (file_ext)
537 free(file_ext); 540 free(file_ext);
538 541