[VFATLIB] Simplify in-memory boot sector copy.
authorPierre Schweitzer <pierre@reactos.org>
Sat, 14 Apr 2018 10:05:32 +0000 (12:05 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 14 Apr 2018 10:05:32 +0000 (12:05 +0200)
So that, coverity is happy again.
NFC

CID 143423014342331434238143424314342461434272

sdk/lib/fslib/vfatlib/fat12.c
sdk/lib/fslib/vfatlib/fat16.c
sdk/lib/fslib/vfatlib/fat32.c

index bf96f8d..1668fc4 100644 (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) */
 
index 1438532..ac38311 100644 (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) */
 
index 1987af4..4e78937 100644 (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) */