[VFATLIB] Simplify in-memory boot sector copy.

So that, coverity is happy again.
NFC

CID 1434230, 1434233, 1434238, 1434243, 1434246, 1434272
This commit is contained in:
Pierre Schweitzer 2018-04-14 12:05:32 +02:00
parent c7bba39afc
commit 38791299ca
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
3 changed files with 3 additions and 6 deletions

View file

@ -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) */

View file

@ -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) */

View file

@ -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) */