diff --git a/kernel/kernel.c b/kernel/kernel.c index e115d35..7241d96 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -176,16 +176,16 @@ int strcasecmp(const char *s1, const char *s2) 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++; *s2++; - n--; } return 0; } - /* stdarg.h functions */ int vsnprintf(char *str, size_t size, const char *format, va_list ap) { diff --git a/src/cacaview.c b/src/cacaview.c index 0fe543d..d0ed2fe 100644 --- a/src/cacaview.c +++ b/src/cacaview.c @@ -15,9 +15,9 @@ #include "common.h" #if !defined(__KERNEL__) -#include -#include -#include +# include +# include +# include #endif #if defined(HAVE_SLEEP) diff --git a/src/img2irc.c b/src/img2irc.c index 7135c50..72eae83 100644 --- a/src/img2irc.c +++ b/src/img2irc.c @@ -16,9 +16,9 @@ #if !defined(__KERNEL__) # include -#include -#include -# endif +# include +# include +#endif #include "cucul.h" #include "common-image.h"