diff options
author | Karel Zak | 2012-10-15 17:01:30 +0200 |
---|---|---|
committer | Karel Zak | 2012-10-15 17:01:30 +0200 |
commit | e37cd480f9ca0709d2c47a545d72e5ae1450ca7f (patch) | |
tree | fe1e2a41ac3cb633d606950cb8c53543c0dcf324 /libblkid | |
parent | swapon: remove loop declaration [smatch scan] (diff) | |
download | kernel-qcow2-util-linux-e37cd480f9ca0709d2c47a545d72e5ae1450ca7f.tar.gz kernel-qcow2-util-linux-e37cd480f9ca0709d2c47a545d72e5ae1450ca7f.tar.xz kernel-qcow2-util-linux-e37cd480f9ca0709d2c47a545d72e5ae1450ca7f.zip |
libblkid: fix compiler warning [-Wstrict-aliasing]
libblkid/src/superblocks/befs.c: In function 'get_uuid':
libblkid/src/superblocks/befs.c:353:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r-- | libblkid/src/superblocks/befs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libblkid/src/superblocks/befs.c b/libblkid/src/superblocks/befs.c index a7f4317ba..452da1ecd 100644 --- a/libblkid/src/superblocks/befs.c +++ b/libblkid/src/superblocks/befs.c @@ -348,9 +348,11 @@ static int get_uuid(blkid_probe pr, const struct befs_super_block *bs, && FS16_TO_CPU(sd->name_size, fs_le) == strlen(KEY_NAME) && FS16_TO_CPU(sd->data_size, fs_le) == KEY_SIZE && strcmp(sd->name, KEY_NAME) == 0) { - *uuid = *(uint64_t *) ((uint8_t *) sd->name - + FS16_TO_CPU(sd->name_size, fs_le) - + 3); + + memcpy(uuid, + sd->name + FS16_TO_CPU(sd->name_size, fs_le) + 3, + sizeof(uint64_t)); + break; } else if (FS32_TO_CPU(sd->type, fs_le) == 0 && FS16_TO_CPU(sd->name_size, fs_le) == 0 |