]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/BdsLib/BdsFilePath.c
ArmPkg/BdsLib: eliminate calls to deprecated string functions
[mirror_edk2.git] / ArmPkg / Library / BdsLib / BdsFilePath.c
index ff421754fe214d9a5e161b73af418be86d401768..f9d8c4c205bfba280ea4197bb6bf2f3bafce1ae9 100644 (file)
@@ -752,14 +752,14 @@ BdsPxeLoadImage (
     return Status;\r
   }\r
 \r
-  Status = LoadFileProtocol->LoadFile (LoadFileProtocol, *DevicePath, TRUE, &BufferSize, NULL);\r
+  Status = LoadFileProtocol->LoadFile (LoadFileProtocol, RemainingDevicePath, TRUE, &BufferSize, NULL);\r
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
     Status = gBS->AllocatePages (Type, EfiBootServicesCode, EFI_SIZE_TO_PAGES(BufferSize), Image);\r
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
 \r
-    Status = LoadFileProtocol->LoadFile (LoadFileProtocol, *DevicePath, TRUE, &BufferSize, (VOID*)(UINTN)(*Image));\r
+    Status = LoadFileProtocol->LoadFile (LoadFileProtocol, RemainingDevicePath, TRUE, &BufferSize, (VOID*)(UINTN)(*Image));\r
     if (!EFI_ERROR (Status) && (ImageSize != NULL)) {\r
       *ImageSize = BufferSize;\r
     }\r
@@ -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
@@ -1198,7 +1200,7 @@ BdsTftpLoadImage (
   if (Mtftp4GetFileSize (Mtftp4, AsciiFilePath, &FileSize) == EFI_SUCCESS) {\r
     TftpBufferSize = FileSize;\r
   } else {\r
-    TftpBufferSize = SIZE_8MB;\r
+    TftpBufferSize = SIZE_16MB;\r
   }\r
 \r
   TftpContext = AllocatePool (sizeof (BDS_TFTP_CONTEXT));\r
@@ -1209,7 +1211,7 @@ BdsTftpLoadImage (
   TftpContext->FileSize = FileSize;\r
 \r
   for (; TftpBufferSize <= FixedPcdGet32 (PcdMaxTftpFileSize);\r
-         TftpBufferSize = (TftpBufferSize + SIZE_8MB) & (~(SIZE_8MB-1))) {\r
+         TftpBufferSize = (TftpBufferSize + SIZE_16MB) & (~(SIZE_16MB-1))) {\r
     //\r
     // Allocate a buffer to hold the whole file.\r
     //\r