mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-04 02:03:13 +02:00
Get rid of stricmp/strnicmp (use strcasecmp/strncasecmp)
This commit is contained in:
@@ -82,7 +82,7 @@ int extban_account_is_banned(aClient *sptr, aChannel *chptr, char *banin, int ty
|
||||
{
|
||||
char *ban = banin+3;
|
||||
|
||||
if (!stricmp(ban, sptr->user->svid))
|
||||
if (!strcasecmp(ban, sptr->user->svid))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ ConfigItem_help *Find_Help(char *command)
|
||||
{
|
||||
if (help->command == NULL)
|
||||
continue;
|
||||
else if (!stricmp(command,help->command))
|
||||
else if (!strcasecmp(command,help->command))
|
||||
return help;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
+2
-2
@@ -365,7 +365,7 @@ CMD_FUNC(m_uid)
|
||||
** client, just reject it. -Lefler
|
||||
** Allow opers to use Q-lined nicknames. -Russell
|
||||
*/
|
||||
if (!stricmp("ircd", nick) || !stricmp("irc", nick))
|
||||
if (!strcasecmp("ircd", nick) || !strcasecmp("irc", nick))
|
||||
{
|
||||
sendnumeric(sptr, ERR_ERRONEUSNICKNAME, nick,
|
||||
"Reserved for internal IRCd purposes");
|
||||
@@ -706,7 +706,7 @@ CMD_FUNC(m_nick)
|
||||
** client, just reject it. -Lefler
|
||||
** Allow opers to use Q-lined nicknames. -Russell
|
||||
*/
|
||||
if (!stricmp("ircd", nick) || !stricmp("irc", nick))
|
||||
if (!strcasecmp("ircd", nick) || !strcasecmp("irc", nick))
|
||||
{
|
||||
sendnumeric(sptr, ERR_ERRONEUSNICKNAME, nick,
|
||||
"Reserved for internal IRCd purposes");
|
||||
|
||||
@@ -125,7 +125,7 @@ RestrictedCmd *find_restrictions_bycmd(char *cmd) {
|
||||
RestrictedCmd *rcmd;
|
||||
for (rcmd = RestrictedCmdList; rcmd; rcmd = rcmd->next)
|
||||
{
|
||||
if (!stricmp(rcmd->cmd, cmd))
|
||||
if (!strcasecmp(rcmd->cmd, cmd))
|
||||
return rcmd;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
+2
-2
@@ -128,9 +128,9 @@ static TKLType *find_TKLType_by_flag(char flag)
|
||||
}
|
||||
|
||||
void rmtkl_check_options(char *param, int *skipperm, int *silent) {
|
||||
if (!stricmp("-skipperm", param))
|
||||
if (!strcasecmp("-skipperm", param))
|
||||
*skipperm = 1;
|
||||
if (!stricmp("-silent", param))
|
||||
if (!strcasecmp("-silent", param))
|
||||
*silent = 1;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -90,7 +90,7 @@ static aClient *decode_puid(char *puid)
|
||||
cookie = atoi(it2);
|
||||
}
|
||||
|
||||
if (stricmp(me.name, puid))
|
||||
if (strcasecmp(me.name, puid))
|
||||
return NULL;
|
||||
|
||||
list_for_each_entry(cptr, &unknown_list, lclient_node)
|
||||
@@ -133,7 +133,7 @@ CMD_FUNC(m_svslogin)
|
||||
if (!SASL_SERVER || MyClient(sptr) || (parc < 3) || !parv[3])
|
||||
return 0;
|
||||
|
||||
if (!stricmp(parv[1], me.name))
|
||||
if (!strcasecmp(parv[1], me.name))
|
||||
{
|
||||
aClient *target_p;
|
||||
|
||||
@@ -180,7 +180,7 @@ CMD_FUNC(m_sasl)
|
||||
if (!SASL_SERVER || MyClient(sptr) || (parc < 4) || !parv[4])
|
||||
return 0;
|
||||
|
||||
if (!stricmp(parv[1], me.name))
|
||||
if (!strcasecmp(parv[1], me.name))
|
||||
{
|
||||
aClient *target_p;
|
||||
|
||||
@@ -196,7 +196,7 @@ CMD_FUNC(m_sasl)
|
||||
make_user(target_p);
|
||||
|
||||
/* reject if another SASL agent is answering */
|
||||
if (*target_p->local->sasl_agent && stricmp(sptr->name, target_p->local->sasl_agent))
|
||||
if (*target_p->local->sasl_agent && strcasecmp(sptr->name, target_p->local->sasl_agent))
|
||||
return 0;
|
||||
else
|
||||
strlcpy(target_p->local->sasl_agent, sptr->name, sizeof(target_p->local->sasl_agent));
|
||||
|
||||
+1
-1
@@ -276,7 +276,7 @@ static inline int stats_operonly_long(char *s)
|
||||
OperStat *os;
|
||||
for (os = iConf.oper_only_stats_ext; os; os = os->next)
|
||||
{
|
||||
if (!stricmp(os->flag, s))
|
||||
if (!strcasecmp(os->flag, s))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -130,7 +130,7 @@ CMD_FUNC(m_svsnline)
|
||||
continue;
|
||||
if (bconf->flag.type2 != CONF_BAN_TYPE_AKILL)
|
||||
continue;
|
||||
if (!stricmp(bconf->mask, parv[2]))
|
||||
if (!strcasecmp(bconf->mask, parv[2]))
|
||||
break;
|
||||
}
|
||||
if (bconf)
|
||||
|
||||
+5
-5
@@ -3374,8 +3374,8 @@ aTKline *_find_tkl_serverban(int type, char *usermask, char *hostmask, int softb
|
||||
{
|
||||
if (tkl->type == type)
|
||||
{
|
||||
if (!stricmp(tkl->ptr.serverban->hostmask, hostmask) &&
|
||||
!stricmp(tkl->ptr.serverban->usermask, usermask))
|
||||
if (!strcasecmp(tkl->ptr.serverban->hostmask, hostmask) &&
|
||||
!strcasecmp(tkl->ptr.serverban->usermask, usermask))
|
||||
{
|
||||
/* And an extra check for soft/hard ban mismatches.. */
|
||||
if ((tkl->ptr.serverban->subtype & TKL_SUBTYPE_SOFT) == softban)
|
||||
@@ -3400,8 +3400,8 @@ aTKline *_find_tkl_banexception(int type, char *usermask, char *hostmask, int so
|
||||
{
|
||||
if (tkl->type == type)
|
||||
{
|
||||
if (!stricmp(tkl->ptr.banexception->hostmask, hostmask) &&
|
||||
!stricmp(tkl->ptr.banexception->usermask, usermask))
|
||||
if (!strcasecmp(tkl->ptr.banexception->hostmask, hostmask) &&
|
||||
!strcasecmp(tkl->ptr.banexception->usermask, usermask))
|
||||
{
|
||||
/* And an extra check for soft/hard ban mismatches.. */
|
||||
if ((tkl->ptr.banexception->subtype & TKL_SUBTYPE_SOFT) == softban)
|
||||
@@ -3423,7 +3423,7 @@ aTKline *_find_tkl_nameban(int type, char *name, int hold)
|
||||
|
||||
for (tkl = tklines[tkl_hash(tpe)]; tkl; tkl = tkl->next)
|
||||
{
|
||||
if ((tkl->type == type) && !stricmp(tkl->ptr.nameban->name, name))
|
||||
if ((tkl->type == type) && !strcasecmp(tkl->ptr.nameban->name, name))
|
||||
return tkl;
|
||||
}
|
||||
return NULL; /* Not found */
|
||||
|
||||
+2
-2
@@ -56,13 +56,13 @@ CMD_FUNC(m_tsctl)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (MyClient(sptr) && (!parv[1] || stricmp(parv[1], "alltime")))
|
||||
if (MyClient(sptr) && (!parv[1] || strcasecmp(parv[1], "alltime")))
|
||||
{
|
||||
sendnotice(sptr, "/TSCTL now shows the time on all servers. You can now longer MODIFY the time.");
|
||||
parv[1] = "alltime";
|
||||
}
|
||||
|
||||
if (parv[1] && !stricmp(parv[1], "alltime"))
|
||||
if (parv[1] && !strcasecmp(parv[1], "alltime"))
|
||||
{
|
||||
sendnotice(sptr, "*** Server=%s TStime=%lld",
|
||||
me.name, (long long)TStime());
|
||||
|
||||
@@ -364,7 +364,7 @@ int websocket_handle_handshake(aClient *sptr, char *readbuf, int *length)
|
||||
r;
|
||||
r = websocket_handshake_helper(NULL, 0, &key, &value, &lastloc, &end_of_request))
|
||||
{
|
||||
if (!stricmp(key, "Sec-WebSocket-Key"))
|
||||
if (!strcasecmp(key, "Sec-WebSocket-Key"))
|
||||
{
|
||||
if (strchr(value, ':'))
|
||||
{
|
||||
|
||||
@@ -441,8 +441,8 @@ char has_common_chan = 0;
|
||||
/* if they only want people with a certain server */
|
||||
if (wfl.want_server != WHO_DONTCARE)
|
||||
{
|
||||
if (((wfl.want_server == WHO_WANT) && stricmp(wfl.server, acptr->user->server)) ||
|
||||
((wfl.want_server == WHO_DONTWANT) && !stricmp(wfl.server, acptr->user->server)))
|
||||
if (((wfl.want_server == WHO_WANT) && strcasecmp(wfl.server, acptr->user->server)) ||
|
||||
((wfl.want_server == WHO_DONTWANT) && !strcasecmp(wfl.server, acptr->user->server)))
|
||||
{
|
||||
return WHO_CANTSEE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user