From faeb3214d42feebf843a8bb7bafbd3754b51d5b8 Mon Sep 17 00:00:00 2001 From: rsun3 Date: Tue, 12 May 2009 03:33:34 +0000 Subject: [PATCH] Fix the implementation of AsciiStrStr() and StrStr() in MdePkg. If the length of SearchString is zero, then String is returned. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8297 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BaseLib/String.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c index 50253de04f..43ba1447b8 100644 --- a/MdePkg/Library/BaseLib/String.c +++ b/MdePkg/Library/BaseLib/String.c @@ -479,7 +479,7 @@ StrStr ( ASSERT (StrSize (SearchString) != 0); if (*SearchString == L'\0') { - return NULL; + return (CHAR16 *) String; } while (*String != L'\0') { @@ -1617,7 +1617,7 @@ AsciiStrStr ( ASSERT (AsciiStrSize (SearchString) != 0); if (*SearchString == '\0') { - return NULL; + return (CHAR8 *) String; } while (*String != '\0') { -- 2.39.2