Revision: 16146
          http://sourceforge.net/p/edk2/code/16146
Author:   shenshushi
Date:     2014-09-19 01:32:05 +0000 (Fri, 19 Sep 2014)
Log Message:
-----------
ShellPkg: Refine code style to avoid potential uninitialized local variable.

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

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
    trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
    trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c

Modified: trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c 2014-09-18 
21:18:22 UTC (rev 16145)
+++ trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c 2014-09-19 
01:32:05 UTC (rev 16146)
@@ -309,10 +309,11 @@
     Response = *Resp;
   }
 
-  DestPath    = NULL;
-  ShellStatus = SHELL_SUCCESS;
-  PathSize    = 0;
-  Cwd         = ShellGetCurrentDir(NULL);
+  DestPath         = NULL;
+  ShellStatus      = SHELL_SUCCESS;
+  PathSize         = 0;
+  Cwd              = ShellGetCurrentDir(NULL);
+  CleanFilePathStr = NULL;
 
   ASSERT(FileList != NULL);
   ASSERT(DestDir  != NULL);

Modified: trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c 2014-09-18 
21:18:22 UTC (rev 16145)
+++ trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c 2014-09-19 
01:32:05 UTC (rev 16146)
@@ -275,9 +275,10 @@
   ASSERT(FileList != NULL);
   ASSERT(DestDir  != NULL);
 
-  DestPath = NULL;
-  Cwd      = ShellGetCurrentDir(NULL);
-  Response = *Resp;
+  DestPath         = NULL;
+  Cwd              = ShellGetCurrentDir(NULL);
+  Response         = *Resp;
+  CleanFilePathStr = NULL;
 
   Status = ShellLevel2StripQuotes (DestDir, &CleanFilePathStr);
   if (EFI_ERROR (Status)) {

Modified: trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c     2014-09-18 
21:18:22 UTC (rev 16145)
+++ trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c     2014-09-19 
01:32:05 UTC (rev 16146)
@@ -1502,6 +1502,8 @@
   ASSERT(Arg      != NULL);
   ASSERT(ListHead != NULL);
 
+  CleanFilePathStr = NULL;
+
   Status = InternalShellStripQuotes (Arg, &CleanFilePathStr);
   if (EFI_ERROR (Status)) {
     return Status;


------------------------------------------------------------------------------
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to