diff options
| author | 2010-01-25 15:41:40 +0100 | |
|---|---|---|
| committer | 2010-01-25 15:41:40 +0100 | |
| commit | 33a7e44b20f44adafe663d11dc36f704b248f3f2 (patch) | |
| tree | 858d9c8c9d9e2ad2439952628ad5bd07c46c8b25 /tools/iphonebackup.c | |
| parent | 3e4694043b0767acede31102f403b4ee8cbb076e (diff) | |
| download | libimobiledevice-33a7e44b20f44adafe663d11dc36f704b248f3f2.tar.gz libimobiledevice-33a7e44b20f44adafe663d11dc36f704b248f3f2.tar.bz2 | |
Improve check for BackupTotalSizeKey and improve message reporting total size
Diffstat (limited to 'tools/iphonebackup.c')
| -rw-r--r-- | tools/iphonebackup.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/iphonebackup.c b/tools/iphonebackup.c index 3fe3a3f..2628871 100644 --- a/tools/iphonebackup.c +++ b/tools/iphonebackup.c | |||
| @@ -445,10 +445,12 @@ int main(int argc, char *argv[]) | |||
| 445 | /* first message contains total backup size */ | 445 | /* first message contains total backup size */ |
| 446 | if (file_index == 0) { | 446 | if (file_index == 0) { |
| 447 | node = plist_dict_get_item(node_tmp, "BackupTotalSizeKey"); | 447 | node = plist_dict_get_item(node_tmp, "BackupTotalSizeKey"); |
| 448 | plist_get_uint_val(node, &backup_total_size); | 448 | if (node) { |
| 449 | format_size = g_format_size_for_display(backup_total_size); | 449 | plist_get_uint_val(node, &backup_total_size); |
| 450 | printf("Backup will need %s on disk.\n", format_size); | 450 | format_size = g_format_size_for_display(backup_total_size); |
| 451 | g_free(format_size); | 451 | printf("Backup data requires %s on the disk.\n", format_size); |
| 452 | g_free(format_size); | ||
| 453 | } | ||
| 452 | } | 454 | } |
| 453 | 455 | ||
| 454 | /* print out "received" if DLFileStatusKey is 2 (last file piece) */ | 456 | /* print out "received" if DLFileStatusKey is 2 (last file piece) */ |
