Add unsigned char cast to is[x]digit

This commit is contained in:
Andrey A. Chernov 1999-11-04 04:52:34 +00:00
parent d67f4d918d
commit fbc8d502c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52863
2 changed files with 5 additions and 5 deletions

View file

@ -518,7 +518,7 @@ _gethostbydnsname(name, af)
* disallow names consisting only of digits/dots, unless
* they end in a dot.
*/
if (isdigit(name[0]))
if (isdigit((unsigned char)name[0]))
for (cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.')
@ -547,10 +547,10 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
if (!isdigit(*cp) && *cp != '.')
if (!isdigit((unsigned char)*cp) && *cp != '.')
break;
}
if ((isxdigit(name[0]) && strchr(name, ':') != NULL) ||
if ((isxdigit((unsigned char)name[0]) && strchr(name, ':') != NULL) ||
name[0] == ':')
for (cp = name;; ++cp) {
if (!*cp) {
@ -578,7 +578,7 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
if (!isxdigit(*cp) && *cp != ':' && *cp != '.')
if (!isxdigit((unsigned char)*cp) && *cp != ':' && *cp != '.')
break;
}

View file

@ -503,7 +503,7 @@ __icheckhost(raddr, lhost)
register char **pp;
/* Try for raw ip address first. */
if (isdigit(*lhost) && (u_int32_t)(laddr = inet_addr(lhost)) != -1)
if (isdigit((unsigned char)*lhost) && (u_int32_t)(laddr = inet_addr(lhost)) != -1)
return (raddr == laddr);
/* Better be a hostname. */