mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
a383ca341e
commit
9fbbbd1222
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue