wrote modcmd bind system
[NeonServV5.git] / main.c
diff --git a/main.c b/main.c
index 1b0ba1c42a92e0c34f380e65e1f4aba0ba2b1db6..564e7b0cfa34db3f328ef80cdd13028c93792250 100644 (file)
--- a/main.c
+++ b/main.c
@@ -58,3 +58,19 @@ int stricmp (const char *s1, const char *s2)
    return c1 - c2;
 }
 
+int stricmplen (const char *s1, const char *s2, int len)
+{
+   if (s1 == NULL) return s2 == NULL ? 0 : -(*s2);
+   if (s2 == NULL) return *s1;
+   char c1, c2;
+   int i = 0;
+   while ((c1 = tolower (*s1)) == (c2 = tolower (*s2)))
+   {
+     i++;
+     if (*s1 == '\0') break;
+     ++s1; ++s2;
+     if(i == len) break;
+   }
+   return c1 - c2;
+}
+