[VFATFS] FATGetNextDirEntry(): Fix 1 MSVC 'warning C4267' (#6179)

Fix `warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data`
by explicitly casting to USHORT.
This is OK as the line immediately before NULL-terminates the buffer within boundary.

Addendum to commit 096a69471 (r6279).
This commit is contained in:
Serge Gautherie 2023-12-23 21:24:51 +01:00 committed by GitHub
parent 77653462a9
commit 3558b7b985
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -460,7 +460,7 @@ FATGetNextDirEntry(
/* Make sure filename is NULL terminate and calculate length */
DirContext->LongNameU.Buffer[DirContext->LongNameU.MaximumLength / sizeof(WCHAR) - 1]
= UNICODE_NULL;
DirContext->LongNameU.Length = wcslen(DirContext->LongNameU.Buffer) * sizeof(WCHAR);
DirContext->LongNameU.Length = (USHORT)(wcslen(DirContext->LongNameU.Buffer) * sizeof(WCHAR));
/* Init short name */
vfat8Dot3ToString(&DirContext->DirEntry.Fat, &DirContext->ShortNameU);