diff options
author | Helge Deller <deller@gmx.de> | 2022-08-08 18:13:48 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-08-08 18:13:48 +0200 |
commit | 8751677c76afeae432f0be7ef1b19a0b302bcd46 (patch) | |
tree | 346b25b96577c4559ee198316cd318373cb92096 | |
parent | 48dc3edcf8949ac7ed1e56476636498ca7de20e0 (diff) | |
download | palo-8751677c76afeae432f0be7ef1b19a0b302bcd46.tar.gz |
ipl/palo: Fix partition detection
Fix a bug where for partitions > 6 a wrong offset was used.
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | lib/diskpart.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/diskpart.c b/lib/diskpart.c index 999d8ed..06f27ac 100644 --- a/lib/diskpart.c +++ b/lib/diskpart.c @@ -68,11 +68,11 @@ load_partitions(int bootdev, struct diskpartition *mptab, int maxparts) break; } - mptab[extnum].start = __le32_to_cpu(ptab[0].start_sect) + offset; - mptab[extnum].length = __le32_to_cpu(ptab[0].nr_sects); + mptab[extnum].start = offset + (__u32)__le32_to_cpu(ptab[0].start_sect); + mptab[extnum].length = (__u32) __le32_to_cpu(ptab[0].nr_sects); mptab[extnum].id = ptab[0].sys_ind; - offset += __le32_to_cpu(ptab[1].start_sect); + offset = mptab[ex].start + (__u32) __le32_to_cpu(ptab[1].start_sect); extnum++; if (!is_extended(ptab[1].sys_ind)) |