summaryrefslogtreecommitdiff
path: root/source/components/utilities/utclib.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/utilities/utclib.c')
-rw-r--r--source/components/utilities/utclib.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/source/components/utilities/utclib.c b/source/components/utilities/utclib.c
index 8cc04f2cc1c3..e68634b18bbb 100644
--- a/source/components/utilities/utclib.c
+++ b/source/components/utilities/utclib.c
@@ -475,28 +475,25 @@ AcpiUtStrstr (
char *String1,
char *String2)
{
- char *String;
+ UINT32 Length;
- if (AcpiUtStrlen (String2) > AcpiUtStrlen (String1))
+ Length = AcpiUtStrlen (String2);
+ if (!Length)
{
- return (NULL);
+ return (String1);
}
- /* Walk entire string, comparing the letters */
-
- for (String = String1; *String2; )
+ while (AcpiUtStrlen (String1) >= Length)
{
- if (*String2 != *String)
+ if (AcpiUtMemcmp (String1, String2, Length) == 0)
{
- return (NULL);
+ return (String1);
}
-
- String2++;
- String++;
+ String1++;
}
- return (String1);
+ return (NULL);
}