From 715096c2448412e54a95092942a397bd4d697524 Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Fri, 19 Sep 2014 01:32:05 +0000 Subject: ShellPkg: Refine code style to avoid potential uninitialized local variable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Jaben Carsey git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16146 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c | 9 +++++---- ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib') diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c index 52c1de8a96..efc14085c3 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c @@ -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); diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c index fcf5f657b8..772cbd27f1 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c @@ -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)) { -- cgit v1.2.3