diff --git a/sdk/lib/fslib/vfatlib/fat12.c b/sdk/lib/fslib/vfatlib/fat12.c index bf96f8d2ec3..1668fc4670e 100644 --- a/sdk/lib/fslib/vfatlib/fat12.c +++ b/sdk/lib/fslib/vfatlib/fat12.c @@ -38,8 +38,7 @@ Fat12WriteBootSector(IN HANDLE FileHandle, RtlZeroMemory(NewBootSector, BootSector->BytesPerSector); /* Copy FAT16 BPB to new bootsector */ - memcpy(&NewBootSector->Jump[0], - &BootSector->Jump[0], + memcpy(NewBootSector, BootSector, FIELD_OFFSET(FAT16_BOOT_SECTOR, Res2) - FIELD_OFFSET(FAT16_BOOT_SECTOR, Jump)); /* FAT16 BPB length (up to (not including) Res2) */ diff --git a/sdk/lib/fslib/vfatlib/fat16.c b/sdk/lib/fslib/vfatlib/fat16.c index 1438532390b..ac383115471 100644 --- a/sdk/lib/fslib/vfatlib/fat16.c +++ b/sdk/lib/fslib/vfatlib/fat16.c @@ -38,8 +38,7 @@ Fat16WriteBootSector(IN HANDLE FileHandle, RtlZeroMemory(NewBootSector, BootSector->BytesPerSector); /* Copy FAT16 BPB to new bootsector */ - memcpy(&NewBootSector->Jump[0], - &BootSector->Jump[0], + memcpy(NewBootSector, BootSector, FIELD_OFFSET(FAT16_BOOT_SECTOR, Res2) - FIELD_OFFSET(FAT16_BOOT_SECTOR, Jump)); /* FAT16 BPB length (up to (not including) Res2) */ diff --git a/sdk/lib/fslib/vfatlib/fat32.c b/sdk/lib/fslib/vfatlib/fat32.c index 1987af4fdde..4e789372d44 100644 --- a/sdk/lib/fslib/vfatlib/fat32.c +++ b/sdk/lib/fslib/vfatlib/fat32.c @@ -38,8 +38,7 @@ Fat32WriteBootSector(IN HANDLE FileHandle, RtlZeroMemory(NewBootSector, BootSector->BytesPerSector); /* Copy FAT32 BPB to new bootsector */ - memcpy(&NewBootSector->Jump[0], - &BootSector->Jump[0], + memcpy(NewBootSector, BootSector, FIELD_OFFSET(FAT32_BOOT_SECTOR, Res2) - FIELD_OFFSET(FAT32_BOOT_SECTOR, Jump)); /* FAT32 BPB length (up to (not including) Res2) */