ShellPkg: Refine code style to avoid potential uninitialized local variable.

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@16146 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Qiu Shumin 2014-09-19 01:32:05 +00:00 committed by shenshushi
parent ee1c2b77f4
commit 715096c244
3 changed files with 11 additions and 7 deletions

View File

@ -309,10 +309,11 @@ ValidateAndCopyFiles(
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);

View File

@ -275,9 +275,10 @@ ValidateAndMoveFiles(
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)) {

View File

@ -1502,6 +1502,8 @@ ShellOpenFileMetaArg (
ASSERT(Arg != NULL);
ASSERT(ListHead != NULL);
CleanFilePathStr = NULL;
Status = InternalShellStripQuotes (Arg, &CleanFilePathStr);
if (EFI_ERROR (Status)) {
return Status;