mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[FASTFAT] Copy an entire field, instead of half-copying it with RtlCopyMemory
Fixes GCC 8 warning: sdk/include/crt/mingw32/intrin_x86.h:76:12: error: 'memmove' offset [21, 40] from the object at 'DirContext' is out of the bounds of referenced subobject 'Attrib' with type 'unsigned char' at offset 19 [-Werror=array-bounds] return memmove(dest, source, num); ^~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
3120320c65
commit
791b1ad7bd
1 changed files with 2 additions and 4 deletions
|
@ -806,11 +806,9 @@ FATAddEntry(
|
|||
{
|
||||
RtlZeroMemory(pFatEntry, DeviceExt->FatInfo.BytesPerCluster);
|
||||
/* create '.' and '..' */
|
||||
RtlCopyMemory(&pFatEntry[0].Attrib, &DirContext.DirEntry.Fat.Attrib,
|
||||
sizeof(FAT_DIR_ENTRY) - FIELD_OFFSET(FAT_DIR_ENTRY, Attrib));
|
||||
pFatEntry[0] = DirContext.DirEntry.Fat;
|
||||
RtlCopyMemory(pFatEntry[0].ShortName, ". ", 11);
|
||||
RtlCopyMemory(&pFatEntry[1].Attrib, &DirContext.DirEntry.Fat.Attrib,
|
||||
sizeof(FAT_DIR_ENTRY) - FIELD_OFFSET(FAT_DIR_ENTRY, Attrib));
|
||||
pFatEntry[1] = DirContext.DirEntry.Fat;
|
||||
RtlCopyMemory(pFatEntry[1].ShortName, ".. ", 11);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue