From 2d3759d8b5f48c487a9ea749ae2e453a58c36f47 Mon Sep 17 00:00:00 2001 From: jcarsey Date: Thu, 17 Nov 2011 21:38:20 +0000 Subject: [PATCH] =?UTF-8?q?ShellPkg:=20Update=20the=20=E2=80=98for?= =?UTF-8?q?=E2=80=99=20command=20to=20check=20number=20length=20correctly?= =?UTF-8?q?=20with=20trailing=20spaces.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fix corrects the logic that checks number length such that is functions correctly without a trailing space. Signed-off-by: jcarsey Reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12736 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellLevel1CommandsLib/For.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c index 121ac50918..7d91d2348f 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c @@ -42,7 +42,7 @@ ShellIsValidForNumber ( } if (StrLen(Number) >= 7) { - if (StrStr(Number, L" ") != NULL && (StrStr(Number, L" ") - Number) >= 7) { + if ((StrStr(Number, L" ") == NULL) || (((StrStr(Number, L" ") != NULL) && (StrStr(Number, L" ") - Number) >= 7))) { return (FALSE); } }