unsigned char-correctness

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5269 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1998-12-20 15:36:03 +00:00
parent 963049f0fa
commit fb8d7e5910
3 changed files with 20 additions and 17 deletions

View File

@@ -75,7 +75,8 @@ __icheckhost(unsigned raddr, const char *lhost)
char **pp;
/* Try for raw ip address first. */
if (isdigit(*lhost) && (long)(laddr = inet_addr(lhost)) != -1)
if (isdigit((unsigned char)*lhost)
&& (long)(laddr = inet_addr(lhost)) != -1)
return (raddr == laddr);
/* Better be a hostname. */
@@ -142,7 +143,8 @@ __ivaliduser(FILE *hostf, unsigned raddr, const char *luser,
continue;
}
while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
*p = isupper(*p) ? tolower(*p) : *p;
if (isupper((unsigned char)*p))
*p = tolower((unsigned char)*p);
p++;
}
if (*p == ' ' || *p == '\t') {