From: Hallvard Furuseth Date: Sun, 19 Jan 2003 14:05:23 +0000 (+0000) Subject: Cast ctype.h arguments to unsigned char. X-Git-Tag: NO_SLAP_OP_BLOCKS~607 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=120e39b533a655e94262717d9281802c1d879366;p=openldap Cast ctype.h arguments to unsigned char. --- diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index 63d2feae42..b0b5fb0e05 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -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; diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index e546287224..5671a92297 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -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); diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 5a03c478b9..ce9d4a0bc5 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -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; }