From 1f743090a5443001acbcf472ded12966fa75e631 Mon Sep 17 00:00:00 2001 From: pk910 Date: Fri, 12 Aug 2011 16:51:30 +0200 Subject: [PATCH] fixed multiple definition of stricmp --- main.c | 14 ++++++++++++++ main.h | 15 ++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/main.c b/main.c index 79cd5d9..9302ee9 100644 --- a/main.c +++ b/main.c @@ -42,3 +42,17 @@ int main(void) clearTempUsers(); } } + +int stricmp (const char *s1, const char *s2) +{ + if (s1 == NULL) return s2 == NULL ? 0 : -(*s2); + if (s2 == NULL) return *s1; + char c1, c2; + while ((c1 = tolower (*s1)) == (c2 = tolower (*s2))) + { + if (*s1 == '\0') break; + ++s1; ++s2; + } + return c1 - c2; +} + diff --git a/main.h b/main.h index f88388b..c25d743 100644 --- a/main.h +++ b/main.h @@ -29,19 +29,6 @@ #define UNUSED_ARG(ARG) ARG #endif -int stricmp (const char *s1, const char *s2) -{ - if (s1 == NULL) return s2 == NULL ? 0 : -(*s2); - if (s2 == NULL) return *s1; - char c1, c2; - while ((c1 = tolower (*s1)) == (c2 = tolower (*s2))) - { - if (*s1 == '\0') break; - ++s1; ++s2; - } - return c1 - c2; -} - #define SOCKET_SELECT_TIME 2 #define NICKLEN 30 @@ -63,4 +50,6 @@ int stricmp (const char *s1, const char *s2) #define TEMPUSER_LIST_INDEX VALID_NICK_CHARS_FIRST_LEN +int stricmp (const char *s1, const char *s2); + #endif \ No newline at end of file -- 2.20.1