| @@ -176,16 +176,16 @@ int strcasecmp(const char *s1, const char *s2) | |||||
| int memcmp(const char *s1, const char *s2, size_t n) | int memcmp(const char *s1, const char *s2, size_t n) | ||||
| { | { | ||||
| while(n) { | |||||
| if(*s1 != *s2) return *s1-*s2; | |||||
| while(n--) | |||||
| { | |||||
| if(*s1 != *s2) | |||||
| return *s1 - *s2; | |||||
| *s1++; | *s1++; | ||||
| *s2++; | *s2++; | ||||
| n--; | |||||
| } | } | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| /* stdarg.h functions */ | /* stdarg.h functions */ | ||||
| int vsnprintf(char *str, size_t size, const char *format, va_list ap) | int vsnprintf(char *str, size_t size, const char *format, va_list ap) | ||||
| { | { | ||||
| @@ -15,9 +15,9 @@ | |||||
| #include "common.h" | #include "common.h" | ||||
| #if !defined(__KERNEL__) | #if !defined(__KERNEL__) | ||||
| #include <stdio.h> | |||||
| #include <string.h> | |||||
| #include <stdlib.h> | |||||
| # include <stdio.h> | |||||
| # include <string.h> | |||||
| # include <stdlib.h> | |||||
| #endif | #endif | ||||
| #if defined(HAVE_SLEEP) | #if defined(HAVE_SLEEP) | ||||
| @@ -16,9 +16,9 @@ | |||||
| #if !defined(__KERNEL__) | #if !defined(__KERNEL__) | ||||
| # include <stdio.h> | # include <stdio.h> | ||||
| #include <string.h> | |||||
| #include <stdlib.h> | |||||
| # endif | |||||
| # include <string.h> | |||||
| # include <stdlib.h> | |||||
| #endif | |||||
| #include "cucul.h" | #include "cucul.h" | ||||
| #include "common-image.h" | #include "common-image.h" | ||||