Fix conversion from 'UINTN' to 'UINT8' warnings

* MSVC generates two of the following in rtstr.c:
  warning C4244: 'function': conversion from 'UINTN' to 'UINT8', possible loss of data
This commit is contained in:
Pete Batard 2018-04-24 13:45:11 +01:00 committed by Nigel Croxon
parent fc5af9e47f
commit 85f1c797f6

View File

@ -71,7 +71,7 @@ RtStrnCpy (
{
UINTN Size = RtStrnLen(Src, Len);
if (Size != Len)
RtSetMem(Dest + Len, '\0', (Len - Size) * sizeof(CHAR16));
RtSetMem(Dest + Len, '\0', (UINT8)((Len - Size) * sizeof(CHAR16)));
RtCopyMem(Dest, Src, Size * sizeof(CHAR16));
}
@ -107,7 +107,7 @@ RtStpnCpy (
{
UINTN Size = RtStrnLen(Src, Len);
if (Size != Len)
RtSetMem(Dest + Len, '\0', (Len - Size) * sizeof(CHAR16));
RtSetMem(Dest + Len, '\0', (UINT8)((Len - Size) * sizeof(CHAR16)));
RtCopyMem(Dest, Src, Size * sizeof(CHAR16));
return Dest + Size;
}