From 33a7e44b20f44adafe663d11dc36f704b248f3f2 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Mon, 25 Jan 2010 15:41:40 +0100 Subject: Improve check for BackupTotalSizeKey and improve message reporting total size --- tools/iphonebackup.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tools') 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[]) /* first message contains total backup size */ if (file_index == 0) { node = plist_dict_get_item(node_tmp, "BackupTotalSizeKey"); - plist_get_uint_val(node, &backup_total_size); - format_size = g_format_size_for_display(backup_total_size); - printf("Backup will need %s on disk.\n", format_size); - g_free(format_size); + if (node) { + plist_get_uint_val(node, &backup_total_size); + format_size = g_format_size_for_display(backup_total_size); + printf("Backup data requires %s on the disk.\n", format_size); + g_free(format_size); + } } /* print out "received" if DLFileStatusKey is 2 (last file piece) */ -- cgit v1.1-32-gdbae