]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/ShellEnvVar.c
ShellPkg: Fix 'EfiShellExecute' doesn't get command status correctly.
[mirror_edk2.git] / ShellPkg / Application / Shell / ShellEnvVar.c
index 8ed14b34a2f48992c0ae3a2b29c53f54d18615af..a8f177e6adae3dd7cc8100e589a6eb5bebbc3fe9 100644 (file)
@@ -339,9 +339,10 @@ SetEnvironmentVariables(
     //\r
     // Copy the string into the Key, leaving the last character allocated as NULL to terminate\r
     //\r
-    StrCpyS( Node->Key, \r
+    StrnCpyS( Node->Key, \r
               StrStr(CurrentString, L"=") - CurrentString + 1, \r
-              CurrentString\r
+              CurrentString,\r
+              StrStr(CurrentString, L"=") - CurrentString\r
               );\r
 \r
     //\r