[coreboot] r3474 - in trunk/payloads/libpayload: drivers i386 include

Ulf Jordan jordan at chalmers.se
Sun Aug 10 11:16:32 CEST 2008


On Sat, 9 Aug 2008, Peter Stuge wrote:

> 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.

Looks good and compiles.

Acked-by: Ulf Jordan <jordan at chalmers.se>


> libpayload: Use u8 for the comparison in memcmp()
>
> Signed-off-by: Peter Stuge <peter at stuge.se>
>
> 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;
>  }




More information about the coreboot mailing list