summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-10-24 16:28:27 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-10-28 12:03:53 +0100
commit9fbbbd1222225981c25ede166426c37920901559 (patch)
tree1fe6a013a225f473ec34cec330ba8e0b9125613b /ArmPkg
parenta383ca341e7531fab2b3fe2a5bc3294d477aa2fb (diff)
downloadedk2-9fbbbd1222225981c25ede166426c37920901559.zip
edk2-9fbbbd1222225981c25ede166426c37920901559.tar.gz
edk2-9fbbbd1222225981c25ede166426c37920901559.tar.bz2
ArmPkg/LinuxLoader: eliminate calls to deprecated string functions
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> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Application/LinuxLoader/Arm/LinuxAtag.c2
-rw-r--r--ArmPkg/Application/LinuxLoader/LinuxLoader.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/ArmPkg/Application/LinuxLoader/Arm/LinuxAtag.c b/ArmPkg/Application/LinuxLoader/Arm/LinuxAtag.c
index fd7ee9c..0b3e248 100644
--- a/ArmPkg/Application/LinuxLoader/Arm/LinuxAtag.c
+++ b/ArmPkg/Application/LinuxLoader/Arm/LinuxAtag.c
@@ -72,7 +72,7 @@ SetupCmdlineTag (
mLinuxKernelCurrentAtag->header.type = ATAG_CMDLINE;
/* place CommandLine into tag */
- AsciiStrCpy (mLinuxKernelCurrentAtag->body.cmdline_tag.cmdline, CmdLine);
+ AsciiStrCpyS (mLinuxKernelCurrentAtag->body.cmdline_tag.cmdline, LineLength, CmdLine);
// move pointer to next tag
mLinuxKernelCurrentAtag = next_tag_address (mLinuxKernelCurrentAtag);
diff --git a/ArmPkg/Application/LinuxLoader/LinuxLoader.c b/ArmPkg/Application/LinuxLoader/LinuxLoader.c
index 70b960b..76697c3 100644
--- a/ArmPkg/Application/LinuxLoader/LinuxLoader.c
+++ b/ArmPkg/Application/LinuxLoader/LinuxLoader.c
@@ -61,6 +61,7 @@ LinuxLoaderEntryPoint (
LIST_ENTRY *ResourceLink;
SYSTEM_MEMORY_RESOURCE *Resource;
EFI_PHYSICAL_ADDRESS SystemMemoryBase;
+ UINTN Length;
Status = gBS->LocateProtocol (
&gEfiDevicePathFromTextProtocolGuid,
@@ -182,12 +183,13 @@ LinuxLoaderEntryPoint (
}
if (LinuxCommandLine != NULL) {
- AsciiLinuxCommandLine = AllocatePool ((StrLen (LinuxCommandLine) + 1) * sizeof (CHAR8));
+ Length = StrLen (LinuxCommandLine) + 1;
+ AsciiLinuxCommandLine = AllocatePool (Length);
if (AsciiLinuxCommandLine == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Error;
}
- UnicodeStrToAsciiStr (LinuxCommandLine, AsciiLinuxCommandLine);
+ UnicodeStrToAsciiStrS (LinuxCommandLine, AsciiLinuxCommandLine, Length);
}
//