[PATCH] make memcmp arguments const

Stefan Assmann sassmann at suse.de
Mon Nov 3 09:34:36 EST 2008


In purgatory/string.c the definition of memcmp is
	int memcmp(void *src1, void *src2, size_t len)
man memcmp reveals
	int memcmp(const void *s1, const void *s2, size_t n)

Signed-off-by: Stefan Assmann <sassmann at suse.de>

---
 purgatory/string.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/purgatory/string.c
+++ b/purgatory/string.c
@@ -36,9 +36,9 @@ void* memcpy(void *dest, const void *src
 }


-int memcmp(void *src1, void *src2, size_t len)
+int memcmp(const void *src1, const void *src2, size_t len)
 {
-	unsigned char *s1, *s2;
+	const unsigned char *s1, *s2;
 	size_t i;
 	s1 = src1;
 	s2 = src2;
-- 
Stefan Assmann          | SUSE LINUX Products GmbH
Software Engineer       | Maxfeldstr. 5, D-90409 Nuernberg
Mail : sassmann at suse.de | GF: Markus Rex, HRB 16746 (AG Nuernberg)



More information about the kexec mailing list