On Sat, Aug 09, 2008 at 02:09:22PM -0600, Jordan Crouse wrote:
> > Maybe cast to unsigned char or u8 instead?
> 
> Yes - we should cast to unsigned everywhere in here.

Here's a patch.


//Peter
libpayload: Use u8 for the comparison in memcmp()

Signed-off-by: Peter Stuge <[EMAIL PROTECTED]>

Index: libc/memory.c
===================================================================
--- libc/memory.c	(revision 3492)
+++ libc/memory.c	(working copy)
@@ -109,6 +109,6 @@
  */
 int memcmp(const void *s1, const void *s2, size_t len)
 {
-	for (; len && *(char *)s1++ == *(char *)s2++; len--) ;
+	for (; len && *(u8 *)s1++ == *(u8 *)s2++; len--) ;
 	return len;
 }
--
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to