fmap: Fix self test failure on PPC64

This commit is contained in:
Richard Hughes 2021-02-12 10:10:37 +00:00
parent c3ecec575b
commit 293ccbf106

View File

@ -186,7 +186,7 @@ fu_fmap_firmware_write (FuFirmware *firmware, GError **error)
.base = GUINT64_TO_LE (priv->base), .base = GUINT64_TO_LE (priv->base),
.size = 0x0, .size = 0x0,
.name = "", .name = "",
.nareas = GUINT32_TO_LE (images->len), .nareas = GUINT16_TO_LE (images->len),
}; };
/* pad to offset */ /* pad to offset */
@ -200,7 +200,7 @@ fu_fmap_firmware_write (FuFirmware *firmware, GError **error)
g_autoptr(GBytes) fw = fu_firmware_image_get_bytes (img); g_autoptr(GBytes) fw = fu_firmware_image_get_bytes (img);
total_sz += g_bytes_get_size (fw); total_sz += g_bytes_get_size (fw);
} }
hdr.size = GUINT16_TO_LE (priv->offset + total_sz); hdr.size = GUINT32_TO_LE (priv->offset + total_sz);
g_byte_array_append (buf, (const guint8 *) &hdr, sizeof(hdr)); g_byte_array_append (buf, (const guint8 *) &hdr, sizeof(hdr));
/* add each area */ /* add each area */