summaryrefslogtreecommitdiffstats
path: root/gptsync/lib.c
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2009-02-09 15:19:38 -1000
committerDavid Cantrell <dcantrell@redhat.com>2009-02-09 15:19:38 -1000
commitb6b9020a3eb20c00ad353b7d5c2a3478e1758aa2 (patch)
tree5d05aa6528081c4a7cb29f8f7ef11307043a6773 /gptsync/lib.c
parent285f446205b68bc499a4c7a5fb0fb9b8501b34b7 (diff)
downloadanaconda-b6b9020a3eb20c00ad353b7d5c2a3478e1758aa2.tar.gz
anaconda-b6b9020a3eb20c00ad353b7d5c2a3478e1758aa2.tar.xz
anaconda-b6b9020a3eb20c00ad353b7d5c2a3478e1758aa2.zip
Fix gptsync/lib.c for gcc strict aliasing rules.
memcpy() instead of cast dereference assign.
Diffstat (limited to 'gptsync/lib.c')
-rw-r--r--gptsync/lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gptsync/lib.c b/gptsync/lib.c
index 271dc9999..f2d71b2e1 100644
--- a/gptsync/lib.c
+++ b/gptsync/lib.c
@@ -316,7 +316,7 @@ UINTN detect_mbrtype_fs(UINT64 partlba, UINTN *parttype, CHARN **fsname)
return status;
// detect XFS
- signature = *((UINT32 *)(sector));
+ memcpy(&signature, sector, sizeof(UINT32));
if (signature == 0x42534658) {
*parttype = 0x83;
*fsname = STR("XFS");
@@ -393,7 +393,7 @@ UINTN detect_mbrtype_fs(UINT64 partlba, UINTN *parttype, CHARN **fsname)
return status;
// detect HFS+
- signature = *((UINT16 *)(sector));
+ memcpy(&signature, sector, sizeof(UINT16));
if (signature == 0x4442) {
*parttype = 0xaf;
if (*((UINT16 *)(sector + 0x7c)) == 0x2B48)