diff --git a/include/misc.h b/include/misc.h index 28cc9c6..616670f 100644 --- a/include/misc.h +++ b/include/misc.h @@ -96,7 +96,6 @@ ChannelList * BX_prepare_command (int *, char *, int); void log_toggle (int, ChannelList *); char *cluster (char *); - int caps_fucknut (register unsigned char *); void do_reconnect (char *); @@ -121,7 +120,6 @@ ChannelList * BX_prepare_command (int *, char *, int); void check_server_connect (int); const char *country(const char *); int do_newuser (char *, char *, char *); - int char_fucknut (register unsigned char *, char, int); BanList *ban_is_on_channel(register char *, register ChannelList *); BanList *eban_is_on_channel(register char *, register ChannelList *); void check_orig_nick(char *); diff --git a/source/misc.c b/source/misc.c index b5920f6..8b3aa32 100644 --- a/source/misc.c +++ b/source/misc.c @@ -4371,55 +4371,6 @@ int count = 0, } -int caps_fucknut (register unsigned char *crap) -{ - int total = 0, allcaps = 0; -/* removed from ComStud client */ - while (*crap) - { - if (isalpha(*crap)) - { - total++; - if (isupper(*crap)) - allcaps++; - } - crap++; - } - if (total > 12) - { - if ( ((unsigned int)(((float) allcaps / (float) total) * 100) >= 75)) - return (1); - } - return (0); -} - -int char_fucknut (register unsigned char *crap, char looking, int max) -{ - int total = strlen(crap), allchar = 0; - - while (*crap) - { - if ((*crap == looking)) - { - crap++; - while(*crap && *crap != looking) - { - allchar++; - crap++; - } - } - if (*crap) - crap++; - } - if (total > 12) - { - if ( ((unsigned int)(((float) allchar / (float) total) * 100)) >= 75) - return (1); - } - return (0); -} - - static char *make_timestamp(int do_timestamp, char *timestr) { static char time_str[61]; diff --git a/source/parse.c b/source/parse.c index 0a20a1d..759126a 100644 --- a/source/parse.c +++ b/source/parse.c @@ -172,6 +172,54 @@ found_auto: return 1; } +static int caps_fucknut (const char *crap) +{ + int total = 0, allcaps = 0; +/* removed from ComStud client */ + while (*crap) + { + if (isalpha((unsigned char)*crap)) + { + total++; + if (isupper((unsigned char)*crap)) + allcaps++; + } + crap++; + } + if (total > 12) + { + if ( ((unsigned int)(((float) allcaps / (float) total) * 100) >= 75)) + return (1); + } + return (0); +} + +static int char_fucknut (const char *crap, char looking, int max) +{ + int total = strlen(crap), allchar = 0; + + while (*crap) + { + if ((*crap == looking)) + { + crap++; + while(*crap && *crap != looking) + { + allchar++; + crap++; + } + } + if (*crap) + crap++; + } + if (total > 12) + { + if ( ((unsigned int)(((float) allchar / (float) total) * 100)) >= 75) + return (1); + } + return (0); +} + int annoy_kicks(int list_type, char *to, char *from, char *ptr, NickList *nick) { int kick_em = 0;