[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Thu Oct 8 20:04:28 UTC 2009


 libparted/labels/gpt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 14533355f3730be9e5f5d9294ce67c32872854c5
Author: Jim Meyering <meyering at redhat.com>
Date:   Thu Oct 8 22:03:37 2009 +0200

    libparted: fix big-endian bug in gpt_get_max_supported_partition_count
    
    * libparted/labels/gpt.c (gpt_get_max_supported_partition_count):
    Convert ->SizeOfPartitionEntry from little-endian to CPU endianness
    here, too.  This is along the same lines as commit d6e9b3bb, but
    with the difference that this code is not reachable via the
    command-line interface.

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index b4549ef..3f4edf7 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -1552,7 +1552,7 @@ gpt_get_max_supported_partition_count (const PedDisk *disk, int *max_n)
 		return false;
 
 	*max_n = (disk->dev->sector_size * (pth->FirstUsableLBA - 2)
-		  / pth->SizeOfPartitionEntry);
+		  / PED_LE32_TO_CPU (pth->SizeOfPartitionEntry));
 	pth_free (pth);
 	return true;
 }



More information about the Parted-commits mailing list