From 52a13b0a49a59b993fb1a38675a0c731d733d228 Mon Sep 17 00:00:00 2001 From: hpa Date: Wed, 12 Dec 2001 06:23:14 +0000 Subject: Don't count partitions for which type == 0 (no partition) --- memdisk/setup.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/memdisk/setup.c b/memdisk/setup.c index 4aa787d2..74284795 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -241,21 +241,23 @@ const struct geometry *get_disk_image_geometry(uint32_t where, uint32_t size) max_c = max_h = 0; max_s = 1; for ( i = 0 ; i < 4 ; i++ ) { - c = ptab[i].start_c + (ptab[i].start_s >> 6); - s = (ptab[i].start_s & 0x3f); - h = ptab[i].start_h; - - if ( max_c < c ) max_c = c; - if ( max_h < h ) max_h = h; - if ( max_s < s ) max_s = s; - - c = ptab[i].end_c + (ptab[i].end_s >> 6); - s = (ptab[i].end_s & 0x3f); - h = ptab[i].end_h; - - if ( max_c < c ) max_c = c; - if ( max_h < h ) max_h = h; - if ( max_s < s ) max_s = s; + if ( ptab[i].type ) { + c = ptab[i].start_c + (ptab[i].start_s >> 6); + s = (ptab[i].start_s & 0x3f); + h = ptab[i].start_h; + + if ( max_c < c ) max_c = c; + if ( max_h < h ) max_h = h; + if ( max_s < s ) max_s = s; + + c = ptab[i].end_c + (ptab[i].end_s >> 6); + s = (ptab[i].end_s & 0x3f); + h = ptab[i].end_h; + + if ( max_c < c ) max_c = c; + if ( max_h < h ) max_h = h; + if ( max_s < s ) max_s = s; + } } max_c++; max_h++; /* Convert to count (1-based) */ -- cgit v1.2.1