fix strstr. Seems the function never worked before, except the searched
authorStefan Reinauer <stepan@coresystems.de>
Fri, 6 Mar 2009 17:43:20 +0000 (17:43 +0000)
committerStefan Reinauer <stepan@openbios.org>
Fri, 6 Mar 2009 17:43:20 +0000 (17:43 +0000)
substring is at the end.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3978 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

payloads/libpayload/libc/string.c

index b9ecb907f61e9d6283e754937b1723494f564870..ec6be1dfb49d79eeb3c03f2031dd6082e2d705fc 100644 (file)
@@ -234,7 +234,7 @@ char *strstr(const char *h, const char *n)
        int i;
 
        for (i = 0; i <= hn - nn; i++)
-               if (!strcmp(&h[i], n))
+               if (!memcmp(&h[i], n, nn))
                        return (char *)&h[i];
 
        return NULL;