summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-01 16:11:59 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-01 16:11:59 +0000
commit5f2915f59380777728344bbbca587d4944f19ed0 (patch)
tree45b161a83329445fb535dbb0a1fe68d48c6b2cb3 /ShellPkg
parentcf4c5a4270f3feb3b5083cb477263ba239154ec7 (diff)
downloadedk2-platforms-5f2915f59380777728344bbbca587d4944f19ed0.tar.xz
fix initialization of pointer.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11498 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Application/Shell/ShellParametersProtocol.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c
index 5fce9e5440..76935333d6 100644
--- a/ShellPkg/Application/Shell/ShellParametersProtocol.c
+++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c
@@ -528,7 +528,7 @@ UpdateStdInStdOutStdErr(
ErrAppend = FALSE;
OutAppend = FALSE;
CommandLineCopy = NULL;
- FirstLocation = (CHAR16*)(-1);
+ FirstLocation = NULL;
if (ShellParameters == NULL || SystemTableInfo == NULL || OldStdIn == NULL || OldStdOut == NULL || OldStdErr == NULL) {
return (EFI_INVALID_PARAMETER);
@@ -551,6 +551,7 @@ UpdateStdInStdOutStdErr(
CommandLineCopy = StrnCatGrow(&CommandLineCopy, NULL, NewCommandLine, 0);
Status = EFI_SUCCESS;
Split = NULL;
+ FirstLocation = CommandLineCopy + StrLen(CommandLineCopy);
StripQuotes(CommandLineCopy);
@@ -810,7 +811,7 @@ UpdateStdInStdOutStdErr(
}
}
- if (FirstLocation != (CHAR16*)(-1)
+ if (FirstLocation != CommandLineCopy + StrLen(CommandLineCopy)
&& ((UINTN)(FirstLocation - CommandLineCopy) < StrLen(NewCommandLine))
){
*(NewCommandLine + (UINTN)(FirstLocation - CommandLineCopy)) = CHAR_NULL;