]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/BdsLib: eliminate calls to deprecated string functions
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 24 Oct 2016 15:31:06 +0000 (16:31 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 28 Oct 2016 11:04:07 +0000 (12:04 +0100)
Remove calls to deprecated string functions like AsciiStrCpy() and
UnicodeStrToAsciiStr()

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/Library/BdsLib/BdsFilePath.c

index aefeaed4ffb59efe3bb1020a55042c416d2e8542..f9d8c4c205bfba280ea4197bb6bf2f3bafce1ae9 100644 (file)
@@ -964,7 +964,7 @@ Mtftp4CheckPacket (
       Step      = (Context->DownloadedNbOfBytes   * TFTP_PROGRESS_SLIDER_STEPS) / Context->FileSize;\r
       if (Step > LastStep) {\r
         Print (mTftpProgressDelete);\r
-        StrCpy (Progress, mTftpProgressFrame);\r
+        CopyMem (Progress, mTftpProgressFrame, sizeof mTftpProgressFrame);\r
         for (Index = 1; Index < Step; Index++) {\r
           Progress[Index] = L'=';\r
         }\r
@@ -1044,6 +1044,7 @@ BdsTftpLoadImage (
   UINT64                   FileSize;\r
   UINT64                   TftpBufferSize;\r
   BDS_TFTP_CONTEXT         *TftpContext;\r
+  UINTN                    PathNameLen;\r
 \r
   ASSERT(IS_DEVICE_PATH_NODE (RemainingDevicePath, MESSAGING_DEVICE_PATH, MSG_IPv4_DP));\r
   IPv4DevicePathNode = (IPv4_DEVICE_PATH*)RemainingDevicePath;\r
@@ -1187,8 +1188,9 @@ BdsTftpLoadImage (
 \r
   // The Device Path might contain multiple FilePath nodes\r
   PathName      = ConvertDevicePathToText ((EFI_DEVICE_PATH_PROTOCOL*)(IPv4DevicePathNode + 1), FALSE, FALSE);\r
-  AsciiFilePath = AllocatePool (StrLen (PathName) + 1);\r
-  UnicodeStrToAsciiStr (PathName, AsciiFilePath);\r
+  PathNameLen   = StrLen (PathName) + 1;\r
+  AsciiFilePath = AllocatePool (PathNameLen);\r
+  UnicodeStrToAsciiStrS (PathName, AsciiFilePath, PathNameLen);\r
 \r
   //\r
   // Try to get the size of the file in bytes from the server. If it fails,\r