Revision: 19398
          http://sourceforge.net/p/edk2/code/19398
Author:   vanjeff
Date:     2015-12-18 07:32:17 +0000 (Fri, 18 Dec 2015)
Log Message:
-----------
ShellPkg: Refine code by initializing local variable and adding ASSERT 
statement.

Add ASSERT statement and initialize local variable to make code more readable.

(Sync patch r18689 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18689

Modified Paths:
--------------
    branches/UDK2015/ShellPkg/Application/Shell/ShellProtocol.c
    branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c

Modified: branches/UDK2015/ShellPkg/Application/Shell/ShellProtocol.c
===================================================================
--- branches/UDK2015/ShellPkg/Application/Shell/ShellProtocol.c 2015-12-18 
07:31:38 UTC (rev 19397)
+++ branches/UDK2015/ShellPkg/Application/Shell/ShellProtocol.c 2015-12-18 
07:32:17 UTC (rev 19398)
@@ -1632,6 +1632,8 @@
   EFI_DEVICE_PATH_PROTOCOL  *DevPath;
   UINTN                     Size;
   EFI_STATUS                CalleeStatusCode;
+
+  CalleeStatusCode = EFI_SUCCESS;
   
   if ((PcdGet8(PcdShellSupportLevel) < 1)) {
     return (EFI_UNSUPPORTED);

Modified: branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
===================================================================
--- branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c    
2015-12-18 07:31:38 UTC (rev 19397)
+++ branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c    
2015-12-18 07:32:17 UTC (rev 19398)
@@ -341,6 +341,7 @@
   }
 
   RemoteFilePath = ShellCommandLineGetRawValue (CheckPackage, 2);
+  ASSERT(RemoteFilePath != NULL);
   AsciiRemoteFilePath = AllocatePool (
                           (StrLen (RemoteFilePath) + 1) * sizeof (CHAR8)
                           );


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to