]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2006-01-03 Marco Gerards <marco@gnu.org>
authormarco_g <marco_g@localhost>
Tue, 3 Jan 2006 16:02:18 +0000 (16:02 +0000)
committermarco_g <marco_g@localhost>
Tue, 3 Jan 2006 16:02:18 +0000 (16:02 +0000)
* partmap/apple.c (apple_partition_map_iterate): Convert the data
read from disk from big endian to host byte order.

ChangeLog
partmap/apple.c

index 4ec5cc97c3e675f8dba291014d21ba07860153d9..8348f90ffdfabb8d42ed91ef682bacff440d95aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-03  Marco Gerards  <marco@gnu.org>
+
+       * partmap/apple.c (apple_partition_map_iterate): Convert the data
+       read from disk from big endian to host byte order.
+
 2006-01-03  Hollis Blanchard  <hollis@penguinppc.org>
 
        * fs/hfs.c: Include <grub/hfs.h>.  Added reference to the official
index 0cb83951c0a90e29c124a8852671aeb1338cbd87..96d7c192ae8d080043e17db4a5cd3bad55197fe4 100644 (file)
@@ -117,28 +117,30 @@ apple_partition_map_iterate (grub_disk_t disk,
                          sizeof (struct grub_apple_part),  (char *) &apart))
        return grub_errno;
 
-      if (apart.magic != GRUB_APPLE_PART_MAGIC)
+      if (grub_be_to_cpu16 (apart.magic) != GRUB_APPLE_PART_MAGIC)
        {
          grub_dprintf ("partition",
                        "partition %d: bad magic (found 0x%x; wanted 0x%x\n",
-                       partno, apart.magic, GRUB_APPLE_PART_MAGIC);
+                       partno, grub_be_to_cpu16 (apart.magic),
+                       GRUB_APPLE_PART_MAGIC);
          break;
        }
 
-      part.start = apart.first_phys_block;
-      part.len = apart.blockcnt;
+      part.start = grub_be_to_cpu32 (apart.first_phys_block);
+      part.len = grub_be_to_cpu32 (apart.blockcnt);
       part.offset = pos;
       part.index = partno;
 
       grub_dprintf ("partition",
                    "partition %d: name %s, type %s, start 0x%x, len 0x%x\n",
                    partno, apart.partname, apart.parttype,
-                   apart.first_phys_block, apart.blockcnt);
+                   grub_be_to_cpu32 (apart.first_phys_block),
+                   grub_be_to_cpu32 (apart.blockcnt));
 
       if (hook (disk, &part))
        return grub_errno;
 
-      if (apart.first_phys_block == GRUB_DISK_SECTOR_SIZE * 2)
+      if (grub_be_to_cpu32 (apart.first_phys_block) == GRUB_DISK_SECTOR_SIZE * 2)
        return 0;
 
       pos += sizeof (struct grub_apple_part);