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:
Kevin Easton
2015-05-05 20:30:07 +10:00
parent 9f7cf6b6c2
commit e646ab42d2
3 changed files with 48 additions and 51 deletions

View File

@@ -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];