Move char_fucknut() and caps_fucknut() from misc.c to parse.c.
These functions are only used by parse.c:annoy_kicks(), so move them next to that function and make them static. This also changes their arguments from unsigned char * to char *, getting rid of some signed/unsigned mismatch warnings.
This commit is contained in:
@@ -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 *);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user