]> jfr.im git - irc/atheme/atheme.git/commitdiff
Correctly call <ctype.h> functions using (unsigned char) casts.
authorJilles Tjoelker <redacted>
Thu, 18 Dec 2014 14:44:20 +0000 (15:44 +0100)
committerJilles Tjoelker <redacted>
Thu, 18 Dec 2014 14:44:20 +0000 (15:44 +0100)
28 files changed:
libathemecore/cidr.c
libathemecore/conf.c
libathemecore/function.c
libathemecore/logger.c
libathemecore/match.c
libathemecore/ptasks.c
libathemecore/reslib.c
libathemecore/services.c
modules/botserv/main.c
modules/chanserv/akick.c
modules/chanserv/list.c
modules/chanserv/main.c
modules/chanserv/set_prefix.c
modules/gameserv/dice.c
modules/nickserv/access.c
modules/nickserv/enforce.c
modules/nickserv/list.c
modules/operserv/akill.c
modules/operserv/clones.c
modules/operserv/sgline.c
modules/operserv/sqline.c
modules/protocol/bahamut.c
modules/protocol/charybdis.c
modules/protocol/inspircd.c
modules/protocol/ts6-generic.c
modules/protocol/unreal.c
modules/transport/jsonrpc/jsonrpclib.c
modules/transport/xmlrpc/xmlrpclib.c

index 08c65cc197212c0a69f48a8f0836d03d4bb666eb..101f22db78694f23133a6435fc772719dc0e0ae7 100644 (file)
@@ -163,7 +163,7 @@ inet_pton6(const char *src, u_char *dst)
        curtok = src;
        saw_xdigit = 0;
        val = 0;
-       while((ch = tolower(*src++)) != '\0')
+       while((ch = tolower((unsigned char)*src++)) != '\0')
        {
                const char *pch;
 
index 8ca588368de2a0f9b1eec4b5955ee40165229934..9994b29503841712ce3f7aa64897d495385e4781 100644 (file)
@@ -303,7 +303,7 @@ static int c_uplink(mowgli_config_file_entry_t *ce)
                conf_report_warning(ce, "uplink's server name %s should not be the same as our server name, continuing anyway", ce->vardata);
        else if (!strchr(ce->vardata, '.'))
                conf_report_warning(ce, "uplink's server name %s is invalid, continuing anyway", ce->vardata);
-       else if (isdigit(ce->vardata[0]))
+       else if (isdigit((unsigned char)ce->vardata[0]))
                conf_report_warning(ce, "uplink's server name %s starts with a digit, probably invalid (continuing anyway)", ce->vardata);
 
        name = ce->vardata;
@@ -898,7 +898,7 @@ bool conf_check(void)
                return false;
        }
 
-       if (isdigit(me.name[0]))
+       if (isdigit((unsigned char)me.name[0]))
                slog(LG_ERROR, "conf_check(): `name' in %s starts with a digit, probably invalid (continuing anyway)", config_file);
 
        if (!me.desc)
index 6a33be38cca8948cecd469b4e69a27c812546f12..aa6214c89a5e2e05b60d91652404eff52c3b2795 100644 (file)
@@ -281,7 +281,7 @@ int validemail(const char *email)
        /* no mail to IP addresses, this should be done using [10.2.3.4]
         * like syntax but we do not allow that either
         */
-       if (isdigit(lastdot[1]))
+       if (isdigit((unsigned char)lastdot[1]))
                return 0;
 
        /* make sure there are at least 4 characters besides the above
index 90ab10580228346cd302de530a88d2ea9fd7d766..e88d04d5bb28a2182fdd6d681b61590b00cda073 100644 (file)
@@ -160,7 +160,7 @@ logfile_strip_control_codes(const char *buf)
                else if (*in == 3)
                {
                        in++;
-                       while (isdigit(*in))
+                       while (isdigit((unsigned char)*in))
                                in++;
                }
        }
index 358ce9fe60903cb580d00b6779e1a0595ad9a773..a6a3e94ecfc793d9a96e3051824f2a1019c0d108 100644 (file)
@@ -105,7 +105,7 @@ const unsigned char ToUpperTab[] = {
 int ToLower(int c)
 {
        if (match_mapping == MATCH_ASCII)
-               return tolower(c);
+               return tolower((unsigned char)c);
        /* else */
        return (ToLowerTab[(unsigned char)(c)]);
 }
@@ -113,7 +113,7 @@ int ToLower(int c)
 int ToUpper(int c)
 {
        if (match_mapping == MATCH_ASCII)
-               return toupper(c);
+               return toupper((unsigned char)c);
        /* else */
        return (ToUpperTab[(unsigned char)(c)]);
 }
@@ -309,7 +309,7 @@ void strcasecanon(char *str)
 {
        while (*str)
        {
-               *str = toupper(*str);
+               *str = toupper((unsigned char)*str);
                str++;
        }
        return;
@@ -659,7 +659,7 @@ char *regex_extract(char *pattern, char **pend, int *pflags)
        bool backslash = false;
 
        c = *pattern;
-       if (isalnum(c) || isspace(c) || c == '\\')
+       if (isalnum((unsigned char)c) || isspace((unsigned char)c) || c == '\\')
                return NULL;
        p = pattern + 1;
        while (*p != c || backslash)
@@ -681,7 +681,7 @@ char *regex_extract(char *pattern, char **pend, int *pflags)
                        *pflags |= AREGEX_PCRE;
                else if (*p == 'K')
                        *pflags |= AREGEX_KLINE;
-               else if (!isalnum(*p))
+               else if (!isalnum((unsigned char)*p))
                        return NULL;
                p++;
        }
index ff13cf8f0c61b58d7d778c017bd948d00a3e41b5..0cc6a73030878c6542498aa5e0820e171041025d 100644 (file)
@@ -590,11 +590,11 @@ void handle_message(sourceinfo_t *si, char *target, bool is_notice, char *messag
                        notice(target_u->nick, si->su->nick, "This is a registered nick enforcer, and not a real user.");
                        return;
                }
-               if (!is_notice && (isalnum(target[0]) || strchr("[\\]^_`{|}~", target[0])))
+               if (!is_notice && (isalnum((unsigned char)target[0]) || strchr("[\\]^_`{|}~", target[0])))
                {
                        /* If it's not a notice and looks like a nick or
                         * user@server, send back an error message */
-                       if (strchr(target, '@') || !ircd->uses_uid || (!ircd->uses_p10 && !isdigit(target[0])))
+                       if (strchr(target, '@') || !ircd->uses_uid || (!ircd->uses_p10 && !isdigit((unsigned char)target[0])))
                                numeric_sts(me.me, 401, si->su, "%s :No such nick", target);
                        else
                                numeric_sts(me.me, 401, si->su, "* :Target left IRC. Failed to deliver: [%.20s]", message);
index 24d06e4a6f20b2d767962b4950396b93d708d53c..44bddcc3a5d7c4af7e0938a6a6fda6e85de4a32a 100644 (file)
@@ -180,7 +180,7 @@ parse_resvconf(void)
 
     p = input;
     /* skip until something thats not a space is seen */
-    while (isspace(*p))
+    while (isspace((unsigned char)*p))
       p++;
     /* if at this point, have a '\0' then continue */
     if (*p == '\0')
@@ -192,7 +192,7 @@ parse_resvconf(void)
 
     /* skip until a space is found */
     opt = p;
-    while (!isspace(*p) && *p != '\0')
+    while (!isspace((unsigned char)*p) && *p != '\0')
       p++;
     if (*p == '\0')
       continue;  /* no arguments?.. ignore this line */
@@ -200,7 +200,7 @@ parse_resvconf(void)
     *p++ = '\0';
 
     /* skip these spaces that are before the argument */
-    while (isspace(*p))
+    while (isspace((unsigned char)*p))
       p++;
     /* Now arg should be right where p is pointing */
     arg = p;
index 885c8cfbb2f3ea9fd8bcc9135cf9536e5dbe29e5..8f90ac3bcfa526a9195b44f8813cfeea9d727473 100644 (file)
@@ -1133,7 +1133,7 @@ bool check_vhost_validity(sourceinfo_t *si, const char *host)
                return false;
        }
        p = strrchr(host, '/');
-       if (p != NULL && isdigit(p[1]))
+       if (p != NULL && isdigit((unsigned char)p[1]))
        {
                command_fail(si, fault_badparams, _("The vhost provided looks like a CIDR mask."));
                return false;
index 1f9cd7b3647866b9b7d76025847e8e88255bc828..9e05220853e78dbab383c1abf49cf97cea06106c 100644 (file)
@@ -380,7 +380,7 @@ botserv_channel_handler(sourceinfo_t *si, int parc, char *parv[])
        if ((sptr = service_find("chanserv")) == NULL)
                return;
 
-       if (strlen(cmd) >= 2 && strchr(prefix, cmd[0]) && isalpha(*++cmd))
+       if (strlen(cmd) >= 2 && strchr(prefix, cmd[0]) && isalpha((unsigned char)*++cmd))
        {
                const char *realcmd = service_resolve_alias(chansvs.me, NULL, cmd);
 
index f5f34eda7a7eec486e22a56c5ac8ccab9289c24e..14451fc759d6ea19319e8dd14dbacc22a54b1768 100644 (file)
@@ -224,7 +224,7 @@ void cs_cmd_akick_add(sourceinfo_t *si, int parc, char *parv[])
                        if (s)
                        {
                                duration = (atol(s) * 60);
-                               while (isdigit(*s))
+                               while (isdigit((unsigned char)*s))
                                        s++;
                                if (*s == 'h' || *s == 'H')
                                        duration *= 60;
index b4ad55247e4ba990a7ac9c3fac1e584b6f7fc991..be8481f800959dd381bfc658d02c61a98f80925d 100644 (file)
@@ -55,7 +55,7 @@ static time_t parse_age(char *s)
        time_t duration;
 
        duration = (atol(s) * 60);
-       while (isdigit(*s))
+       while (isdigit((unsigned char)*s))
                s++;
 
        if (*s == 'h' || *s == 'H')
index 59881b851331db3f2cd21d51a528637438c32895..b9a8aa36108c15f17e260fb371c15ae380dd2865 100644 (file)
@@ -120,7 +120,7 @@ static void chanserv(sourceinfo_t *si, int parc, char *parv[])
                metadata_t *md = metadata_find(mc, "private:prefix");
                const char *prefix = (md ? md->value : chansvs.trigger);
 
-               if (strlen(cmd) >= 2 && strchr(prefix, cmd[0]) && isalpha(*++cmd))
+               if (strlen(cmd) >= 2 && strchr(prefix, cmd[0]) && isalpha((unsigned char)*++cmd))
                {
                        const char *realcmd = service_resolve_alias(si->service, NULL, cmd);
 
@@ -147,7 +147,7 @@ static void chanserv(sourceinfo_t *si, int parc, char *parv[])
                        command_exec_split(si->service, si, realcmd, newargs, si->service->commands);
                        mc->flags &= ~MC_FORCEVERBOSE;
                }
-               else if (!ircncasecmp(cmd, chansvs.nick, strlen(chansvs.nick)) && !isalnum(cmd[strlen(chansvs.nick)]) && (cmd = strtok(NULL, "")) != NULL)
+               else if (!ircncasecmp(cmd, chansvs.nick, strlen(chansvs.nick)) && !isalnum((unsigned char)cmd[strlen(chansvs.nick)]) && (cmd = strtok(NULL, "")) != NULL)
                {
                        const char *realcmd;
                        char *pptr;
index 9e9b3de259dcfe45b6452db78806817f928173ba..90ee9f1cb80f909f15ff9658144cc050d1789600 100644 (file)
@@ -54,8 +54,8 @@ static int goodprefix(const char *p)
        int hasnonprint = 0;
 
        for (i = 0; p[i]; i++) {
-               if (!isspace(p[i])) { haschar = 1; }
-               if (!isprint(p[i])) { hasnonprint = 1; }
+               if (!isspace((unsigned char)p[i])) { haschar = 1; }
+               if (!isprint((unsigned char)p[i])) { hasnonprint = 1; }
        }
 
        return haschar && !hasnonprint;
index c53a74e990125d50fd88751f3c3814a48321e0a2..842537e660e0dd52e896cde85aaf7ac46a3acb5b 100644 (file)
@@ -100,7 +100,7 @@ static bool eval_calc(sourceinfo_t *si, char *s_input)
        }
 
        // Skip leading whitespace
-       while (*ci && isspace(*ci))
+       while (*ci && isspace((unsigned char)*ci))
                ci++;
 
        if (!*ci)
@@ -121,7 +121,7 @@ static bool eval_calc(sourceinfo_t *si, char *s_input)
                        if (--braces < 0)
                                break;  // mismatched!
                }
-               else if (!isspace(*ci) && !isdigit(*ci) && *ci != '.' && !is_calcoper(*ci))
+               else if (!isspace((unsigned char)*ci) && !isdigit((unsigned char)*ci) && *ci != '.' && !is_calcoper(*ci))
                {
                        command_fail(si, fault_badparams, _("Error: You typed an invalid expression."));
                        return false;
@@ -317,7 +317,7 @@ int do_calc_expr(sourceinfo_t *si, char *expr, char *errmsg, double *presult)
                        return 1;
                }
                // skip whitespace
-               while (*cur && isspace(*cur))
+               while (*cur && isspace((unsigned char)*cur))
                        cur++;
        }
 
@@ -466,16 +466,16 @@ static bool eval_dice(sourceinfo_t *si, char *s_input)
        unsigned int dice, roll, x, y, z = 0;
        double total;
 
-       while (*c && isspace(*c))
+       while (*c && isspace((unsigned char)*c))
                ++c;
-       if (!*c || !isdigit(*c))
+       if (!*c || !isdigit((unsigned char)*c))
        {
                gs_command_report(si, _("Syntax: XdY [ {-|+|*|/} Z ]"));
                return false;
        }
 
        x = strtoul(c, &c, 10);
-       if (x == 0 || c == NULL || ToLower(*c++) != 'd' || !isdigit(*c))
+       if (x == 0 || c == NULL || ToLower(*c++) != 'd' || !isdigit((unsigned char)*c))
        {
                if (x < 1 || x > DICE_MAX_DICE)
                {
@@ -490,7 +490,7 @@ static bool eval_dice(sourceinfo_t *si, char *s_input)
        y = strtoul(c, &c, 10);
        if (c != NULL)
        {
-               while (*c && isspace(*c))
+               while (*c && isspace((unsigned char)*c))
                        ++c;
 
                if (*c && strchr("-+*/", *c) == NULL)
@@ -518,7 +518,7 @@ static bool eval_dice(sourceinfo_t *si, char *s_input)
 
                z = strtoul(c, &c, 10);
 
-               while (*c && isspace(*c))
+               while (*c && isspace((unsigned char)*c))
                        ++c;
 
                if (*c)
index cdecafc3188afd16333b7f417cb3395a5be81e1a..1061e87b94d694819e411846d2d1e405c1877365 100644 (file)
@@ -45,11 +45,11 @@ static bool username_is_random(const char *name)
        p = name;
        while (*p != '\0')
        {
-               if (isdigit(*p))
+               if (isdigit((unsigned char)*p))
                        digit++;
-               else if (isupper(*p))
+               else if (isupper((unsigned char)*p))
                        upper++;
-               else if (islower(*p))
+               else if (islower((unsigned char)*p))
                        lower++;
                p++;
        }
@@ -91,7 +91,7 @@ static char *construct_mask(user_t *u)
                                prevdot = p;
                                havedigits = false;
                        }
-                       else if (isdigit(*p))
+                       else if (isdigit((unsigned char)*p))
                                havedigits = true;
                        p++;
                }
@@ -116,7 +116,7 @@ static bool mangle_wildcard_to_cidr(const char *host, char *dest, size_t destlen
 
        if ((p[0] != '0' || p[1] != '.') && ((i = atoi(p)) < 1 || i > 255))
                return false;
-       while (isdigit(*p))
+       while (isdigit((unsigned char)*p))
                p++;
        if (*p++ != '.')
                return false;
@@ -128,7 +128,7 @@ static bool mangle_wildcard_to_cidr(const char *host, char *dest, size_t destlen
 
        if ((p[0] != '0' || p[1] != '.') && ((i = atoi(p)) < 1 || i > 255))
                return false;
-       while (isdigit(*p))
+       while (isdigit((unsigned char)*p))
                p++;
        if (*p++ != '.')
                return false;
@@ -140,7 +140,7 @@ static bool mangle_wildcard_to_cidr(const char *host, char *dest, size_t destlen
 
        if ((p[0] != '0' || p[1] != '.') && ((i = atoi(p)) < 1 || i > 255))
                return false;
-       while (isdigit(*p))
+       while (isdigit((unsigned char)*p))
                p++;
        if (*p++ != '.')
                return false;
@@ -278,7 +278,7 @@ static void ns_cmd_access(sourceinfo_t *si, int parc, char *parv[])
                p = mask;
                while (*p != '\0')
                {
-                       if (!isprint(*p) || *p == ' ' || *p == '!')
+                       if (!isprint((unsigned char)*p) || *p == ' ' || *p == '!')
                        {
                                command_fail(si, fault_badparams, _("Invalid mask \2%s\2."), parv[1]);
                                return;
@@ -312,7 +312,7 @@ static void ns_cmd_access(sourceinfo_t *si, int parc, char *parv[])
                }
                else if ((p = strrchr(host, '/')) != NULL)
                {
-                       if (isdigit(p[1]) && (atoi(p + 1) < 16 || (mask[0] == '*' && mask[1] == '@')))
+                       if (isdigit((unsigned char)p[1]) && (atoi(p + 1) < 16 || (mask[0] == '*' && mask[1] == '@')))
                        {
                                command_fail(si, fault_badparams, _("Too wide mask \2%s\2."), parv[1]);
                                return;
@@ -341,7 +341,7 @@ static void ns_cmd_access(sourceinfo_t *si, int parc, char *parv[])
                                        p = host;
 
                                /* No wildcarded IPs */
-                               if (isdigit(p[1]) && (strchr(host, '*') || strchr(host, '?')))
+                               if (isdigit((unsigned char)p[1]) && (strchr(host, '*') || strchr(host, '?')))
                                {
                                        command_fail(si, fault_badparams, _("Too wide mask \2%s\2."), parv[1]);
                                        return;
index b70d833f833996f61c4fbeb0fe28a49f319b771a..a74bf9dea9f1f2b15f1d44033e53f343f60d9cf8 100644 (file)
@@ -494,7 +494,7 @@ static void check_registration(hook_user_register_check_t *hdata)
        if (hdata->approved)
                return;
 
-       if (!strncasecmp(hdata->account, nicksvs.enforce_prefix, prefixlen) && isdigit(hdata->account[prefixlen]))
+       if (!strncasecmp(hdata->account, nicksvs.enforce_prefix, prefixlen) && isdigit((unsigned char)hdata->account[prefixlen]))
        {
                command_fail(hdata->si, fault_badparams, "The nick \2%s\2 is reserved and cannot be registered.", hdata->account);
                hdata->approved = 1;
index 7ecb77cffe25b2a313f59d8a734a83bf01f3e81f..60909cd097e7cb1413689d45bba33a3f72732263 100644 (file)
@@ -169,7 +169,7 @@ static time_t parse_age(char *s)
        time_t duration;
 
        duration = (atol(s) * 60);
-       while (isdigit(*s))
+       while (isdigit((unsigned char)*s))
                s++;
 
        if (*s == 'h' || *s == 'H')
index 0ab9175280fb6454eb61e9945645d1c03a0ae3b9..10709d4355fb96120143eef326057e8acf323453 100644 (file)
@@ -153,7 +153,7 @@ static void os_cmd_akill_add(sourceinfo_t *si, int parc, char *parv[])
                if (s)
                {
                        duration = (atol(s) * 60);
-                       while (isdigit(*s))
+                       while (isdigit((unsigned char)*s))
                                s++;
                        if (*s == 'h' || *s == 'H')
                                duration *= 60;
@@ -473,7 +473,7 @@ static void os_cmd_akill_list(sourceinfo_t *si, int parc, char *parv[])
                        host = param;
                        full = true;
                }
-               else if (isdigit(param[0]) &&
+               else if (isdigit((unsigned char)param[0]) &&
                                (num = strtoul(param, NULL, 10)) != 0)
                        full = true;
                else
index 0712cf38e52d748537d7f04c306ea3a02db663f2..0af514230abcaf2414fe5206691af639854ce8d3 100644 (file)
@@ -381,7 +381,7 @@ static void os_cmd_clones_kline(sourceinfo_t *si, int parc, char *parv[])
                wallops("\2%s\2 disabled CLONES klines", get_oper_name(si));
                logcommand(si, CMDLOG_ADMIN, "CLONES:KLINE:OFF");
        }
-       else if (isdigit(arg[0]))
+       else if (isdigit((unsigned char)arg[0]))
        {
                unsigned int newgrace = atol(arg);
                if (kline_enabled && grace_count == newgrace)
@@ -486,7 +486,7 @@ static void os_cmd_clones_addexempt(sourceinfo_t *si, int parc, char *parv[])
                expiry += 3;
 
                duration = (atol(expiry) * 60);
-               while (isdigit(*expiry))
+               while (isdigit((unsigned char)*expiry))
                        ++expiry;
                if (*expiry == 'h' || *expiry == 'H')
                        duration *= 60;
@@ -720,7 +720,7 @@ static void os_cmd_clones_setexempt(sourceinfo_t *si, int parc, char *parv[])
                                        else
                                        {
                                                duration = (atol(expiry) * 60);
-                                               while (isdigit(*expiry))
+                                               while (isdigit((unsigned char)*expiry))
                                                        ++expiry;
                                                if (*expiry == 'h' || *expiry == 'H')
                                                        duration *= 60;
@@ -787,7 +787,7 @@ static void os_cmd_clones_duration(sourceinfo_t *si, int parc, char *parv[])
        }
 
        duration = (atol(s) * 60);
-       while (isdigit(*s))
+       while (isdigit((unsigned char)*s))
                s++;
        if (*s == 'h' || *s == 'H')
                duration *= 60;
index b06bfcd3502c56d13eb5df6000d64f678762fe63..4ead974001543fae33428e9c52c5dceaa5e7873a 100644 (file)
@@ -154,7 +154,7 @@ static void os_cmd_sgline_add(sourceinfo_t *si, int parc, char *parv[])
                if (s)
                {
                        duration = (atol(s) * 60);
-                       while (isdigit(*s))
+                       while (isdigit((unsigned char)*s))
                                s++;
                        if (*s == 'h' || *s == 'H')
                                duration *= 60;
index 14a84ba70ba4c4c2b6cf6942988514df23e239a1..d643317a81a56cd9ef1042d6dfe40b8b667b05be 100644 (file)
@@ -189,7 +189,7 @@ static void os_cmd_sqline_add(sourceinfo_t *si, int parc, char *parv[])
                if (s)
                {
                        duration = (atol(s) * 60);
-                       while (isdigit(*s))
+                       while (isdigit((unsigned char)*s))
                                s++;
                        if (*s == 'h' || *s == 'H')
                                duration *= 60;
index ca809e9b7f1c85c2e6196b0a20cd6c5bb31ed620..9a05de9100b458efbfe80afcec3a4dd283fe67f4 100644 (file)
@@ -101,7 +101,7 @@ static bool check_jointhrottle(const char *value, channel_t *c, mychan_t *mc, us
                                return false;
                        arg2 = p + 1;
                }
-               else if (!isdigit(*p))
+               else if (!isdigit((unsigned char)*p))
                        return false;
                p++;
        }
index cff6d4423ad0d669753f4dc40b03da12433eab43..587872df61ac15e6ea1221eee82609c8f691207c 100644 (file)
@@ -148,7 +148,7 @@ static bool check_jointhrottle(const char *value, channel_t *c, mychan_t *mc, us
                                return false;
                        arg2 = p + 1;
                }
-               else if (!isdigit(*p))
+               else if (!isdigit((unsigned char)*p))
                        return false;
                p++;
        }
index f8f31560da691b8df55ceb05db72888ecf95c520..ea89c45b0619600586532fc86ad3cff076d354db 100644 (file)
@@ -252,7 +252,7 @@ static bool check_jointhrottle(const char *value, channel_t *c, mychan_t *mc, us
                                return false;
                        arg2 = p + 1;
                }
-               else if (!isdigit(*p))
+               else if (!isdigit((unsigned char)*p))
                        return false;
                p++;
        }
@@ -290,7 +290,7 @@ static bool check_rejoindelay(const char *value, channel_t *c, mychan_t *mc, use
 
        while (*ch)
        {
-               if (!isdigit(*ch))
+               if (!isdigit((unsigned char)*ch))
                        return false;
                ch++;
        }
@@ -311,7 +311,7 @@ static bool check_delaymsg(const char *value, channel_t *c, mychan_t *mc, user_t
 
        while (*ch)
        {
-               if (!isdigit(*ch))
+               if (!isdigit((unsigned char)*ch))
                        return false;
                ch++;
        }
index ce6c02c69e2c2a54d63f97f362140911221a281f..5c5c526f4d26813112a95302dd25e8c104a7261f 100644 (file)
@@ -73,7 +73,7 @@ static unsigned int ts6_server_login(void)
                ircd->uses_uid = false;
                ret = sts("PASS %s :TS", curr_uplink->send_pass);
        }
-       else if (strlen(me.numeric) == 3 && isdigit(*me.numeric))
+       else if (strlen(me.numeric) == 3 && isdigit((unsigned char)*me.numeric))
        {
                ircd->uses_uid = true;
                ret = sts("PASS %s TS 6 :%s", curr_uplink->send_pass, me.numeric);
index 8e891a7fa0bc6237a14cdf467d9cea3f4cd6aee7..390dcce7100ee39e411a6f468159881d840163c8 100644 (file)
@@ -125,7 +125,7 @@ static bool check_jointhrottle(const char *value, channel_t *c, mychan_t *mc, us
                                return false;
                        arg2 = p + 1;
                }
-               else if (!isdigit(*p))
+               else if (!isdigit((unsigned char)*p))
                        return false;
                p++;
        }
@@ -156,7 +156,7 @@ static inline bool check_flood_old(const char *value, channel_t *c, mychan_t *mc
        {
                if (*value == '*' && !found_colon)
                        found_colon = true;
-               else if (!isdigit(*value))
+               else if (!isdigit((unsigned char)*value))
                        return false;
 
                value++;
@@ -201,7 +201,7 @@ static bool check_flood(const char *value, channel_t *c, mychan_t *mc, user_t *u
 
        for (p = strtok(ep, ","); p != NULL; p = strtok(NULL, ","))
        {
-               while (isdigit(*p))
+               while (isdigit((unsigned char)*p))
                        p++;
 
                if (!VALID_FLOOD_CHAR(*p))
index 28f454d984be889437e5e93b1733026dd9ec0436..37c04eecc490fada8eda45da5d61a15780c58fa5 100644 (file)
@@ -161,7 +161,7 @@ char *jsonrpc_normalizeBuffer(const char *buf)
                                /* Color ctrl char */
                        case 3:
                                /* If the next character is a digit, its also removed */
-                               if (isdigit(buf[i + 1]))
+                               if (isdigit((unsigned char)buf[i + 1]))
                                {
                                        i++;
 
@@ -169,7 +169,7 @@ char *jsonrpc_normalizeBuffer(const char *buf)
                                         * which are two digit but no worse then
                                         * how the Unreal does with +S - TSL
                                         */
-                                       if (isdigit(buf[i + 1]))
+                                       if (isdigit((unsigned char)buf[i + 1]))
                                        {
                                                i++;
                                        }
@@ -181,7 +181,7 @@ char *jsonrpc_normalizeBuffer(const char *buf)
                                        {
                                                i++;
 
-                                               if (isdigit(buf[i + 1]))
+                                               if (isdigit((unsigned char)buf[i + 1]))
                                                {
                                                        i++;
                                                }
@@ -189,7 +189,7 @@ char *jsonrpc_normalizeBuffer(const char *buf)
                                                 * which are two digit but no worse then
                                                 * how the Unreal does with +S - TSL
                                                 */
-                                               if (isdigit(buf[i + 1]))
+                                               if (isdigit((unsigned char)buf[i + 1]))
                                                {
                                                        i++;
                                                }
index dfae381c85cbc7c38c5722f2b218dff2b04c81e8..b67d215233c84f6fa74b8e1b4de72fca902eea21 100644 (file)
@@ -626,7 +626,7 @@ char *xmlrpc_normalizeBuffer(const char *buf)
                          /* Color ctrl char */
                  case 3:
                          /* If the next character is a digit, its also removed */
-                         if (isdigit(buf[i + 1]))
+                         if (isdigit((unsigned char)buf[i + 1]))
                          {
                                  i++;
 
@@ -634,7 +634,7 @@ char *xmlrpc_normalizeBuffer(const char *buf)
                                   * which are two digit but no worse then
                                   * how the Unreal does with +S - TSL
                                   */
-                                 if (isdigit(buf[i + 1]))
+                                 if (isdigit((unsigned char)buf[i + 1]))
                                  {
                                          i++;
                                  }
@@ -646,7 +646,7 @@ char *xmlrpc_normalizeBuffer(const char *buf)
                                  {
                                          i++;
 
-                                         if (isdigit(buf[i + 1]))
+                                         if (isdigit((unsigned char)buf[i + 1]))
                                          {
                                                  i++;
                                          }
@@ -654,7 +654,7 @@ char *xmlrpc_normalizeBuffer(const char *buf)
                                           * which are two digit but no worse then
                                           * how the Unreal does with +S - TSL
                                           */
-                                         if (isdigit(buf[i + 1]))
+                                         if (isdigit((unsigned char)buf[i + 1]))
                                          {
                                                  i++;
                                          }