If the partition is unused, then attempting to decode the PBR would
actually decode the MBR from sector 0 of the disk. Don't do it if v_flag < 3.
This commit is contained in:
parent
c41ceea6c9
commit
29a92a49d4
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fdisk.c,v 1.110 2007/11/29 23:19:25 dsl Exp $ */
|
||||
/* $NetBSD: fdisk.c,v 1.111 2007/12/23 08:14:28 apb Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -39,7 +39,7 @@
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: fdisk.c,v 1.110 2007/11/29 23:19:25 dsl Exp $");
|
||||
__RCSID("$NetBSD: fdisk.c,v 1.111 2007/12/23 08:14:28 apb Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#define MBRPTYPENAMES
|
||||
@ -746,6 +746,9 @@ print_mbr_partition(struct mbr_sector *boot, int part,
|
||||
partp->mbrp_ehd, MBR_PSECT(partp->mbrp_esect));
|
||||
}
|
||||
|
||||
if (partp->mbrp_type == 0 && start == 0 && v_flag < 3)
|
||||
return;
|
||||
|
||||
if (! MBR_IS_EXTENDED(partp->mbrp_type))
|
||||
print_pbr(start, indent + 8, partp->mbrp_type);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user