[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH 2/2] Fix gptsync/lib.c for gcc strict aliasing rules.
- From: David Cantrell <dcantrell redhat com>
- To: anaconda-devel-list redhat com
- Cc:
- Subject: [PATCH 2/2] Fix gptsync/lib.c for gcc strict aliasing rules.
- Date: Mon, 9 Feb 2009 15:20:40 -1000
memcpy() instead of cast dereference assign.
---
gptsync/lib.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gptsync/lib.c b/gptsync/lib.c
index 271dc99..f2d71b2 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)
--
1.6.1.2
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]