summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2016-06-15 13:39:13 +0800
committerStar Zeng <star.zeng@intel.com>2016-06-21 12:46:26 +0800
commit46213c8eb4055d3a75e3fca9daa7a48c1ba41217 (patch)
tree8e04cb5bfa55dd2043e7ed640896efcd80e9d712 /ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
parentb7c7179338ace62c76e39f1270cfce0fc57ae73f (diff)
downloadedk2-platforms-46213c8eb4055d3a75e3fca9daa7a48c1ba41217.tar.xz
ShellPkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr
It is the follow up of 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49 to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c')
-rw-r--r--ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
index 6561270df5..666ee9d8ea 100644
--- a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
+++ b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
@@ -272,6 +272,7 @@ ShellCommandRunTftp (
CONST CHAR16 *ValueStr;
CONST CHAR16 *RemoteFilePath;
CHAR8 *AsciiRemoteFilePath;
+ UINTN FilePathSize;
CONST CHAR16 *Walker;
CONST CHAR16 *LocalFilePath;
EFI_MTFTP4_CONFIG_DATA Mtftp4ConfigData;
@@ -358,14 +359,13 @@ ShellCommandRunTftp (
RemoteFilePath = ShellCommandLineGetRawValue (CheckPackage, 2);
ASSERT(RemoteFilePath != NULL);
- AsciiRemoteFilePath = AllocatePool (
- (StrLen (RemoteFilePath) + 1) * sizeof (CHAR8)
- );
+ FilePathSize = StrLen (RemoteFilePath) + 1;
+ AsciiRemoteFilePath = AllocatePool (FilePathSize);
if (AsciiRemoteFilePath == NULL) {
ShellStatus = SHELL_OUT_OF_RESOURCES;
goto Error;
}
- UnicodeStrToAsciiStr (RemoteFilePath, AsciiRemoteFilePath);
+ UnicodeStrToAsciiStrS (RemoteFilePath, AsciiRemoteFilePath, FilePathSize);
if (ParamCount == 4) {
LocalFilePath = ShellCommandLineGetRawValue (CheckPackage, 3);