]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Refine code by initializing local variable and adding ASSERT statement.
authorQiu Shumin <shumin.qiu@intel.com>
Wed, 28 Oct 2015 01:14:34 +0000 (01:14 +0000)
committershenshushi <shenshushi@Edk2>
Wed, 28 Oct 2015 01:14:34 +0000 (01:14 +0000)
Add ASSERT statement and initialize local variable to make code more readable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18689 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Application/Shell/ShellProtocol.c
ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c

index af00fe401d9c49eba3bc656b2e1a6aa5a8e01b97..fc13595dbb038727ce04564b4b9f5e4ac8023c2a 100644 (file)
@@ -1632,6 +1632,8 @@ EfiShellExecute(
   EFI_DEVICE_PATH_PROTOCOL  *DevPath;\r
   UINTN                     Size;\r
   EFI_STATUS                CalleeStatusCode;\r
+\r
+  CalleeStatusCode = EFI_SUCCESS;\r
   \r
   if ((PcdGet8(PcdShellSupportLevel) < 1)) {\r
     return (EFI_UNSUPPORTED);\r
index 02099febef08358fa99846fe2e30019894980192..831b9c3d0250c342a4c19ee0073d5be65fe90981 100644 (file)
@@ -341,6 +341,7 @@ ShellCommandRunTftp (
   }\r
 \r
   RemoteFilePath = ShellCommandLineGetRawValue (CheckPackage, 2);\r
+  ASSERT(RemoteFilePath != NULL);\r
   AsciiRemoteFilePath = AllocatePool (\r
                           (StrLen (RemoteFilePath) + 1) * sizeof (CHAR8)\r
                           );\r