summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2020-11-12 13:33:36 -0800
committerBrian C. Lane <bcl@redhat.com>2020-11-20 14:00:58 -0800
commit006ad756c70603212309157fa05c5d855e25f07e (patch)
tree70d8544f208817b4ca9556b06c71a9630c766e19
parent6cb1ed79543f9a9425de2b334a41e08836edc6b8 (diff)
downloadparted-006ad756c70603212309157fa05c5d855e25f07e.tar.gz
hfs/hfs: Fix gcc 10 warnings about cast alignment
-rw-r--r--libparted/fs/r/hfs/hfs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c
index 0aababd..09899da 100644
--- a/libparted/fs/r/hfs/hfs.c
+++ b/libparted/fs/r/hfs/hfs.c
@@ -891,12 +891,11 @@ hfsplus_wrapper_update (PedFileSystem* fs)
ref.record_number = 1;
}
- ref.record_pos =
- PED_BE16_TO_CPU (*((uint16_t *)
- (node + (PED_SECTOR_SIZE_DEFAULT
- - 2*ref.record_number))));
+ uint16_t value;
+ memcpy(&value, node+PED_SECTOR_SIZE_DEFAULT - (2*ref.record_number), sizeof(uint16_t));
+ ref.record_pos = PED_BE16_TO_CPU(value);
ret_key = (HfsExtentKey*) (node + ref.record_pos);
- ret_data = (HfsExtDescriptor*) ( node + ref.record_pos
+ ret_data = (HfsExtDescriptor*) (node + ref.record_pos
+ sizeof (HfsExtentKey) );
}