On 10/28/16 12:48, Ard Biesheuvel wrote:
> Get rid of functions that are no longer available when defining
> DISABLE_NEW_DEPRECATED_INTERFACES
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org>
> ---
>  ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c | 
> 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git 
> a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c 
> b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c
> index 4d0811cc5eaf..64b25f8a8c45 100644
> --- 
> a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c
> +++ 
> b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c
> @@ -269,7 +269,7 @@ ArmFastbootPlatformInit (
>  
>        // Copy handle and partition name
>        Entry->PartitionHandle = AllHandles[LoopIndex];
> -      StrnCpy (
> +      CopyMem (
>          Entry->PartitionName,
>          PartitionEntries[PartitionNode->PartitionNumber - 1].PartitionName, 
> // Partition numbers start from 1.
>          PARTITION_NAME_MAX_LENGTH
> @@ -320,7 +320,8 @@ ArmFastbootPlatformFlashPartition (
>    CHAR16                   PartitionNameUnicode[60];
>    BOOLEAN                  PartitionFound;
>  
> -  AsciiStrToUnicodeStr (PartitionName, PartitionNameUnicode);
> +  AsciiStrToUnicodeStrS (PartitionName, PartitionNameUnicode,
> +    ARRAY_SIZE (PartitionNameUnicode));

Congratulations on the first genuine use of the now-central ARRAY_SIZE()
macro! :)

>  
>    PartitionFound = FALSE;
>    Entry = (FASTBOOT_PARTITION_LIST *) GetFirstNode (&(mPartitionListHead));
> @@ -396,7 +397,7 @@ ArmFastbootPlatformGetVar (
>    )
>  {
>    if (AsciiStrCmp (Name, "product")) {
> -    AsciiStrCpy (Value, FixedPcdGetPtr (PcdFirmwareVendor));
> +    AsciiStrCpyS (Value, 61, FixedPcdGetPtr (PcdFirmwareVendor));
>    } else {
>      *Value = '\0';
>    }

Right.

> @@ -410,7 +411,7 @@ ArmFastbootPlatformOemCommand (
>  {
>    CHAR16 CommandUnicode[65];
>  
> -  AsciiStrToUnicodeStr (Command, CommandUnicode);
> +  AsciiStrToUnicodeStrS (Command, CommandUnicode, ARRAY_SIZE 
> (CommandUnicode));
>  
>    if (AsciiStrCmp (Command, "Demonstrate") == 0) {
>      DEBUG ((EFI_D_ERROR, "ARM OEM Fastboot command 'Demonstrate' 
> received.\n"));
> 

I knew ARRAY_SIZE() would be especially useful with these "safe string"
functions! :)

Reviewed-by: Laszlo Ersek <ler...@redhat.com>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to