summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhpa <hpa>2001-12-12 06:23:14 +0000
committerhpa <hpa>2001-12-12 06:23:14 +0000
commit52a13b0a49a59b993fb1a38675a0c731d733d228 (patch)
tree269e623b798e1513f8e8927c7554c89078f3d916
parent33122a0c2f3d069010cf9248e523410bd29b4ee5 (diff)
downloadsyslinux-52a13b0a49a59b993fb1a38675a0c731d733d228.tar.gz
Don't count partitions for which type == 0 (no partition)
-rw-r--r--memdisk/setup.c32
1 files 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) */