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);
}
}
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.
if (*tptr == '.')
break;
- if (isdigit(*tptr) || *tptr == '-')
+ if (isdigit((unsigned char)*tptr) || *tptr == '-')
continue;
*tptr = b26_alphabet[(*tptr * accum) % 26];
/* 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