]> git.proxmox.com Git - mirror_edk2.git/commitdiff
fix initialization of pointer.
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 1 Apr 2011 16:11:59 +0000 (16:11 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 1 Apr 2011 16:11:59 +0000 (16:11 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11498 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Application/Shell/ShellParametersProtocol.c

index 5fce9e5440c25b0c696a9bfbb8ede0db116d85da..76935333d6e373fd83fdf2e0b9f01856899efdc7 100644 (file)
@@ -528,7 +528,7 @@ UpdateStdInStdOutStdErr(
   ErrAppend       = FALSE;\r
   OutAppend       = FALSE;\r
   CommandLineCopy = NULL;\r
-  FirstLocation   = (CHAR16*)(-1);\r
+  FirstLocation   = NULL;\r
 \r
   if (ShellParameters == NULL || SystemTableInfo == NULL || OldStdIn == NULL || OldStdOut == NULL || OldStdErr == NULL) {\r
     return (EFI_INVALID_PARAMETER);\r
@@ -551,6 +551,7 @@ UpdateStdInStdOutStdErr(
   CommandLineCopy = StrnCatGrow(&CommandLineCopy, NULL, NewCommandLine, 0);\r
   Status          = EFI_SUCCESS;\r
   Split           = NULL;\r
+  FirstLocation   = CommandLineCopy + StrLen(CommandLineCopy);\r
 \r
   StripQuotes(CommandLineCopy);\r
 \r
@@ -810,7 +811,7 @@ UpdateStdInStdOutStdErr(
     }\r
   }\r
 \r
-  if (FirstLocation != (CHAR16*)(-1) \r
+  if (FirstLocation != CommandLineCopy + StrLen(CommandLineCopy)\r
     && ((UINTN)(FirstLocation - CommandLineCopy) < StrLen(NewCommandLine))\r
     ){\r
     *(NewCommandLine + (UINTN)(FirstLocation - CommandLineCopy)) = CHAR_NULL;\r