diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-04-09 23:08:47 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-04-09 23:08:47 +0000 |
commit | d29c30140bd8ea81e0530ad3975c977891ab9275 (patch) | |
tree | 7a91c0da98a89b4b10beda84d027d2c779673064 /source/components/utilities/utclib.c | |
parent | 2872953d4a9c9c4e0fc0b9ab37d0e962909625a0 (diff) |
Notes
Diffstat (limited to 'source/components/utilities/utclib.c')
-rw-r--r-- | source/components/utilities/utclib.c | 21 |
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); } |