[coreboot] r3978 - trunk/payloads/libpayload/libc

svn at coreboot.org svn at coreboot.org
Fri Mar 6 18:43:20 CET 2009


Author: stepan
Date: 2009-03-06 18:43:20 +0100 (Fri, 06 Mar 2009)
New Revision: 3978

Modified:
   trunk/payloads/libpayload/libc/string.c
Log:
fix strstr. Seems the function never worked before, except the searched
substring is at the end.

Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Stefan Reinauer <stepan at coresystems.de>



Modified: trunk/payloads/libpayload/libc/string.c
===================================================================
--- trunk/payloads/libpayload/libc/string.c	2009-03-06 17:24:29 UTC (rev 3977)
+++ trunk/payloads/libpayload/libc/string.c	2009-03-06 17:43:20 UTC (rev 3978)
@@ -234,7 +234,7 @@
 	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;





More information about the coreboot mailing list