[PATCH] fix computation of largest partition number

Jim Meyering meyering at redhat.com
Tue Jul 8 08:41:20 UTC 2008


* libparted/arch/linux.c (_disk_sync_part_table): s/PED_MAX/PED_MIN/
(_dm_reread_part_table): Likewise.
Patch by Petr Uzel (tiny change).
Details in http://thread.gmane.org/gmane.comp.gnu.parted.devel/2213
---
 libparted/arch/linux.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 3b8838a..19ddae5 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2212,7 +2212,7 @@ static int
 _disk_sync_part_table (PedDisk* disk)
 {
         int     i;
-        int     last = PED_MAX (ped_disk_get_last_partition_num (disk), 16);
+        int     last = PED_MIN (ped_disk_get_last_partition_num (disk), 16);
         int*    rets = ped_malloc(sizeof(int) * last);
         int*    errnums = ped_malloc(sizeof(int) * last);
         int     ret = 1;
@@ -2433,7 +2433,7 @@ static int
 _dm_reread_part_table (PedDisk* disk)
 {
         int     rc = 1;
-        int     last = PED_MAX (ped_disk_get_last_partition_num (disk), 16);
+        int     last = PED_MIN (ped_disk_get_last_partition_num (disk), 16);
         int     i;

         sync();
--
1.5.6.2.222.gf3584




More information about the parted-devel mailing list