summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2014-09-09 01:47:19 +0000
committershenshushi <shenshushi@6f19259b-4bc3-4df7-8a09-765794883524>2014-09-09 01:47:19 +0000
commitcc72674b58c3430c2f4a876ecf8a0474a717a235 (patch)
tree53aa5fc2f55b4ffe34cc1be951d259350c2e8bfb /ShellPkg
parent0d5d829c0e0614337de8ad1c6d85b713d25fe5c7 (diff)
downloadedk2-platforms-cc72674b58c3430c2f4a876ecf8a0474a717a235.tar.xz
ShellPkg: Replace assignment statement with 'StrnCpy' to append terminal NULL character in a string.
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@16064 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Application/Shell/Shell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
index a60f49af81..40588759a2 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -1486,7 +1486,7 @@ ShellConvertVariables (
; MasterEnvList != NULL && *MasterEnvList != CHAR_NULL
; MasterEnvList += StrLen(MasterEnvList) + 1
){
- *ItemTemp = L'%';
+ StrnCpy(ItemTemp, L"%", ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16))-1);
StrnCat(ItemTemp, MasterEnvList, ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16))-1 - StrLen(ItemTemp));
StrnCat(ItemTemp, L"%", ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16))-1 - StrLen(ItemTemp));
ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, ItemTemp, EfiShellGetEnv(MasterEnvList), TRUE, FALSE);