Compiles down to the same code. Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx> --- fdisks/sfdisk.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fdisks/sfdisk.c b/fdisks/sfdisk.c index 3450f52..e59d52a 100644 --- a/fdisks/sfdisk.c +++ b/fdisks/sfdisk.c @@ -1561,12 +1561,14 @@ msdos_partition(char *dev, int fd, unsigned long start, struct disk_desc *z) { return 0; } - unsigned int sig = *(unsigned short *)(s->data + 2); - if (sig <= 0x1ae - && *(unsigned short *)(s->data + sig) == 0x55aa - && (1 & *(unsigned char *)(s->data + sig + 2))) { + unsigned short sig, magic; + memcpy(&sig, s->data + 2, sizeof(sig)); + if (sig <= 0x1ae) { + memcpy(&magic, s->data + sig, sizeof(magic)); + if (magic == 0x55aa && (1 & *(unsigned char *)(s->data + sig + 2))) { warnx(_("DM6 signature found - giving up\n")); return 0; + } } for (pno = 0; pno < 4; pno++, cp += sizeof(struct partition)) { -- 1.7.12 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html