diff options
author | marcel <marcel@FreeBSD.org> | 2007-12-09 22:44:22 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2007-12-09 22:44:22 +0000 |
commit | 2f8a94b8fec936548bcd831e5afb947311d31666 (patch) | |
tree | a177e8c7dab892dde031fada72059f8e6b90ea69 /sys/geom/geom_bsd_enc.c | |
parent | 3d56eaad5fae38526ef1a2beb6ff139c66fe1508 (diff) | |
download | FreeBSD-src-2f8a94b8fec936548bcd831e5afb947311d31666.zip FreeBSD-src-2f8a94b8fec936548bcd831e5afb947311d31666.tar.gz |
Decode as many or as few partition entries as the label claims there
are. We have already checked it against the caller provided maxpart.
Diffstat (limited to 'sys/geom/geom_bsd_enc.c')
-rw-r--r-- | sys/geom/geom_bsd_enc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/geom_bsd_enc.c b/sys/geom/geom_bsd_enc.c index a526cac..79b2bbc 100644 --- a/sys/geom/geom_bsd_enc.c +++ b/sys/geom/geom_bsd_enc.c @@ -127,7 +127,7 @@ bsd_disklabel_le_dec(u_char *ptr, struct disklabel *d, int maxpart) d->d_npartitions = le16dec(ptr + 138); d->d_bbsize = le32dec(ptr + 140); d->d_sbsize = le32dec(ptr + 144); - for (i = 0; i < MAXPARTITIONS; i++) + for (i = 0; i < d->d_npartitions; i++) bsd_partition_le_dec(ptr + 148 + 16 * i, &d->d_partitions[i]); return(0); } |