From 46213c8eb4055d3a75e3fca9daa7a48c1ba41217 Mon Sep 17 00:00:00 2001
From: Star Zeng <star.zeng@intel.com>
Date: Wed, 15 Jun 2016 13:39:13 +0800
Subject: 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>
---
 ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c')

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);
-- 
cgit v1.2.3