summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-05-24 17:09:45 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2009-05-24 17:09:45 +0200
commit06e4c760a4bb6fc62355d62603f48ebd5dd8961f (patch)
treef66e63b7f6ac899098d59cbbb6bbb48170ed425b
parent3fe4d08afb5386d41d5c1739ed973ef194ab26e1 (diff)
Fix EFI partition table backup
-rw-r--r--src/savehdr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/savehdr.c b/src/savehdr.c
index 00017de..a1d1cff 100644
--- a/src/savehdr.c
+++ b/src/savehdr.c
@@ -73,7 +73,8 @@ int save_header(disk_t *disk_car,partition_t *partition, const int verbose)
case STATUS_DELETED: status='D'; break;
}
snprintf((char*)buffer,256*DEFAULT_SECTOR_SIZE,"%s\n%2u %c Sys=%02X %5u %3u %2u %5u %3u %2u %10lu\n",
- disk_car->description(disk_car), partition->order,status,disk_car->arch->get_part_type(partition),
+ disk_car->description(disk_car), partition->order, status,
+ (disk_car->arch->get_part_type!=NULL ? disk_car->arch->get_part_type(partition) : 0),
offset2cylinder(disk_car,partition->part_offset), offset2head(disk_car,partition->part_offset),offset2sector(disk_car,partition->part_offset),
offset2cylinder(disk_car,partition->part_offset+partition->part_size-disk_car->sector_size), offset2head(disk_car,partition->part_offset+partition->part_size-disk_car->sector_size),offset2sector(disk_car,partition->part_offset+partition->part_size-disk_car->sector_size),
(unsigned long)(partition->part_size/disk_car->sector_size));
@@ -242,7 +243,8 @@ int partition_save(disk_t *disk_car, list_part_t *list_part, const int verbose)
fprintf(f_backup,"%2d : start=%9lu, size=%9lu, Id=%02X, %c\n",
parts->part->order, (unsigned long)(parts->part->part_offset/disk_car->sector_size),
(unsigned long)(parts->part->part_size/disk_car->sector_size),
- disk_car->arch->get_part_type(parts->part), status);
+ (disk_car->arch->get_part_type!=NULL ? disk_car->arch->get_part_type(parts->part) : 0),
+ status);
}
break;
default: