Cast ctype.h arguments to unsigned char.

This commit is contained in:
Hallvard Furuseth 2003-01-19 14:05:23 +00:00
parent f963a16150
commit 120e39b533
3 changed files with 11 additions and 7 deletions

View File

@ -619,17 +619,19 @@ parse_ldif_control( char *line,
pcolon = s; /* Save this position for later */
if (*s++ != ':') /* Make sure colon follows */
return ( LDAP_PARAM_ERROR );
while (*s && isspace(*s)) s++; /* Skip white space before OID */
while (*s && isspace((unsigned char)*s))
s++; /* Skip white space before OID */
/* OID should come next. Validate and extract it. */
if (*s == 0)
return ( LDAP_PARAM_ERROR );
oidStart = s;
while (isdigit(*s) || *s == '.') s++; /* OID should be digits or . */
while (isdigit((unsigned char)*s) || *s == '.')
s++; /* OID should be digits or . */
if (s == oidStart)
return ( LDAP_PARAM_ERROR ); /* OID was not present */
if (*s) { /* End of OID should be space or NULL */
if (!isspace(*s))
if (!isspace((unsigned char)*s))
return ( LDAP_PARAM_ERROR ); /* else OID contained invalid chars */
*s++ = 0; /* Replace space with null to terminate */
}
@ -640,7 +642,8 @@ parse_ldif_control( char *line,
return ( LDAP_NO_MEMORY );
/* Optional Criticality field is next. */
while (*s && isspace(*s)) s++; /* Skip white space before criticality */
while (*s && isspace((unsigned char)*s))
s++; /* Skip white space before criticality */
if (strncasecmp(s, "true", 4) == 0) {
criticality = 1;
s += 4;
@ -651,7 +654,8 @@ parse_ldif_control( char *line,
}
/* Optional value field is next */
while (*s && isspace(*s)) s++; /* Skip white space before value */
while (*s && isspace((unsigned char)*s))
s++; /* Skip white space before value */
if (*s) {
if (*s != ':') { /* If value is present, must start with : */
rc = LDAP_PARAM_ERROR;

View File

@ -737,7 +737,7 @@ getNextPage:
}
buf[i] = '\0';
if ( i > 0 && isdigit( buf[0] ) ) {
if ( i > 0 && isdigit( (unsigned char)buf[0] ) ) {
int num = sscanf( buf, "%d", &tmpSize );
if ( num != 1 ) {
fprintf( stderr, "Invalid value for PagedResultsControl, %s.\n", buf);

View File

@ -1004,7 +1004,7 @@ ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in )
LDAP_FREE(n2);
} else
#endif
if ((ptr = strrchr(name, '.')) && isdigit(ptr[1])) {
if ((ptr = strrchr(name, '.')) && isdigit((unsigned char)ptr[1])) {
if (inet_aton(name, (struct in_addr *)&addr))
ntype = IS_IP4;
}