]> jfr.im git - solanum.git/blobdiff - extensions/ip_cloaking_3.0.c
Remove old .indent.pro files
[solanum.git] / extensions / ip_cloaking_3.0.c
index 470ba0154614791d506e495f4f7a8021a1e7131f..e378a72faf56e299a1d70a4cb3e1a7b58490fbcf 100644 (file)
@@ -124,11 +124,11 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
 
        if(ipv6)
        {
-           rb_snprintf(outbuf, HOSTLEN, "%s:%x", buf, accum);
+           snprintf(outbuf, HOSTLEN, "%s:%x", buf, accum);
        }
        else
        {
-           rb_snprintf(outbuf, HOSTLEN, "%s.%x", buf, accum);
+           snprintf(outbuf, HOSTLEN, "%s.%x", buf, accum);
        }
 }
 
@@ -141,7 +141,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
 
        strncpy(outbuf, inbuf, HOSTLEN);
 
-       /* pass 1: scramble first section of hostname using base26 
+       /* pass 1: scramble first section of hostname using base26
         * alphabet toasted against the weighted entropy of the string.
         *
         * numbers are not changed at this time, only letters.
@@ -151,7 +151,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
                if (*tptr == '.')
                        break;
 
-               if (isdigit(*tptr) || *tptr == '-')
+               if (isdigit((unsigned char)*tptr) || *tptr == '-')
                        continue;
 
                *tptr = b26_alphabet[(*tptr * accum) % 26];
@@ -160,11 +160,11 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
        /* pass 2: scramble each number in the address */
        for (tptr = outbuf; *tptr != '\0'; tptr++)
        {
-               if (isdigit(*tptr))
+               if (isdigit((unsigned char)*tptr))
                {
                        *tptr = 48 + ((*tptr * accum) % 10);
                }
-       }       
+       }
 }
 
 static void