From 5a8da39aa73168170bfbf37924f592d72d4ef4e5 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 28 Mar 2007 21:15:50 +0000 Subject: Fix problem where memcmp would return true in the case where the character after the character that was the same. Submitted by: jhay --- sys/boot/arm/at91/libat91/memcmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/boot') diff --git a/sys/boot/arm/at91/libat91/memcmp.c b/sys/boot/arm/at91/libat91/memcmp.c index bc157cf65e12..322042f23cf2 100644 --- a/sys/boot/arm/at91/libat91/memcmp.c +++ b/sys/boot/arm/at91/libat91/memcmp.c @@ -34,5 +34,5 @@ p_memcmp(const char *to, const char *from, unsigned size) while ((--size) && (*to++ == *from++)) continue; - return (*to != *from); + return (size || (*to != *from)); } -- cgit v1.3