]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Replace assignment statement with 'StrnCpy' to append terminal NULL charact...
authorQiu Shumin <shumin.qiu@intel.com>
Tue, 9 Sep 2014 01:47:19 +0000 (01:47 +0000)
committershenshushi <shenshushi@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 9 Sep 2014 01:47:19 +0000 (01:47 +0000)
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

ShellPkg/Application/Shell/Shell.c

index a60f49af814c0f58984e0f914a8d6efee1573b97..40588759a2e9e8ea1279f5daec8591d5d6a7cae0 100644 (file)
@@ -1486,7 +1486,7 @@ ShellConvertVariables (
     ;  MasterEnvList != NULL && *MasterEnvList != CHAR_NULL\r
     ;  MasterEnvList += StrLen(MasterEnvList) + 1\r
    ){\r
-    *ItemTemp = L'%';\r
+    StrnCpy(ItemTemp, L"%", ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16))-1);\r
     StrnCat(ItemTemp, MasterEnvList, ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16))-1 - StrLen(ItemTemp));\r
     StrnCat(ItemTemp, L"%", ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16))-1 - StrLen(ItemTemp));\r
     ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, ItemTemp, EfiShellGetEnv(MasterEnvList), TRUE, FALSE);\r