From: Hallvard Furuseth Date: Mon, 22 Feb 1999 17:57:22 +0000 (+0000) Subject: Cast `char' arguments to ctype.h functions to `unsigned char'. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~549 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=73db912500316a665638e66e0ff442699b03127b;p=openldap Cast `char' arguments to ctype.h functions to `unsigned char'. These functions require their arguments to be in the range of `unsigned char'. --- diff --git a/clients/fax500/main.c b/clients/fax500/main.c index 115bcd3936..5cd49dbf81 100644 --- a/clients/fax500/main.c +++ b/clients/fax500/main.c @@ -1147,7 +1147,7 @@ do_noemailorfax( FILE *fp, Error *err, int namelen, int errtype ) != NULL ) { for ( i = 0; vals[i]; i++ ) { last = strlen( vals[i] ) - 1; - if ( isdigit( vals[i][last] ) ) { + if ( isdigit((unsigned char) vals[i][last]) ) { rdn = strdup( vals[i] ); break; } @@ -1185,7 +1185,7 @@ do_noemailorfax( FILE *fp, Error *err, int namelen, int errtype ) for ( i = 0; vals[0][i] != '\0'; i++ ) { if ( vals[0][i] == '$' ) { fprintf( fp, "\n%*s ", namelen, " " ); - while ( isspace( vals[0][i+1] ) ) + while ( isspace((unsigned char) vals[0][i+1]) ) i++; } else { fprintf( fp, "%c", vals[0][i] ); @@ -1234,7 +1234,7 @@ do_ambiguous( FILE *fp, Error *err, int namelen ) if ( (vals = ldap_get_values( ld, e, "cn" )) != NULL ) { for ( i = 0; vals[i]; i++ ) { last = strlen( vals[i] ) - 1; - if ( isdigit( vals[i][last] ) ) { + if ( isdigit((unsigned char) vals[i][last]) ) { rdn = strdup( vals[i] ); break; } diff --git a/clients/fax500/rp500.c b/clients/fax500/rp500.c index 1c7276fd9f..d3373d3d4d 100644 --- a/clients/fax500/rp500.c +++ b/clients/fax500/rp500.c @@ -188,7 +188,7 @@ main( int argc, char **argv ) cn = ldap_get_values( ld, e, "cn" ); for ( i = 0; cn[i] != NULL; i++ ) { last = strlen( cn[i] ) - 1; - if ( isdigit( cn[i][last] ) ) { + if ( isdigit((unsigned char) cn[i][last]) ) { rdn = strdup( cn[i] ); break; } diff --git a/clients/finger/main.c b/clients/finger/main.c index 87b1a2c9d9..defb810157 100644 --- a/clients/finger/main.c +++ b/clients/finger/main.c @@ -233,7 +233,7 @@ do_query( void ) p = buf; } - for ( ; *p && isspace( *p ); p++ ) + for ( ; *p && isspace( (unsigned char) *p ); p++ ) ; /* NULL */ do_search( ld, p ); @@ -376,7 +376,7 @@ do_search( LDAP *ld, char *buf ) cn = ldap_get_values( ld, e, "cn" ); for ( i = 0; cn[i] != NULL; i++ ) { last = strlen( cn[i] ) - 1; - if ( isdigit( cn[i][last] ) ) { + if (isdigit((unsigned char) cn[i][last])) { rdn = strdup( cn[i] ); break; } diff --git a/clients/gopher/go500.c b/clients/gopher/go500.c index 47f127d939..1be51161c0 100644 --- a/clients/gopher/go500.c +++ b/clients/gopher/go500.c @@ -380,7 +380,7 @@ do_queries( int s ) query = buf; /* strip off leading white space */ - while ( isspace( *query )) { + while ( isspace( (unsigned char) *query )) { ++query; --len; } diff --git a/clients/gopher/go500gw.c b/clients/gopher/go500gw.c index 4735947c0e..e420821389 100644 --- a/clients/gopher/go500gw.c +++ b/clients/gopher/go500gw.c @@ -409,7 +409,7 @@ do_queries( int s ) query = buf; /* strip off leading white space */ - while ( isspace( *query )) { + while ( isspace( (unsigned char) *query )) { ++query; --len; } diff --git a/clients/mail500/main.c b/clients/mail500/main.c index 99673b40f7..f885feec4c 100644 --- a/clients/mail500/main.c +++ b/clients/mail500/main.c @@ -1319,7 +1319,7 @@ do_noemail( FILE *fp, Error *err, int namelen ) != NULL ) { for ( i = 0; vals[i]; i++ ) { last = strlen( vals[i] ) - 1; - if ( isdigit( vals[i][last] ) ) { + if ( isdigit((unsigned char) vals[i][last]) ) { rdn = strdup( vals[i] ); break; } @@ -1357,7 +1357,7 @@ do_noemail( FILE *fp, Error *err, int namelen ) for ( i = 0; vals[0][i] != '\0'; i++ ) { if ( vals[0][i] == '$' ) { fprintf( fp, "\n%*s ", namelen, " " ); - while ( isspace( vals[0][i+1] ) ) + while ( isspace((unsigned char) vals[0][i+1]) ) i++; } else { fprintf( fp, "%c", vals[0][i] ); @@ -1406,7 +1406,7 @@ do_ambiguous( FILE *fp, Error *err, int namelen ) if ( (vals = ldap_get_values( ld, e, "cn" )) != NULL ) { for ( i = 0; vals[i]; i++ ) { last = strlen( vals[i] ) - 1; - if ( isdigit( vals[i][last] ) ) { + if (isdigit((unsigned char) vals[i][last])) { rdn = strdup( vals[i] ); break; } diff --git a/clients/rcpt500/main.c b/clients/rcpt500/main.c index 2ea4d740f2..449c1b8a5a 100644 --- a/clients/rcpt500/main.c +++ b/clients/rcpt500/main.c @@ -236,7 +236,7 @@ read_hdr( FILE *fp, int offset, char *buf, int MAXSIZEe, char **linep ) { char *hdr; - for ( hdr = buf + offset; isspace( *hdr ); ++hdr ) { + for ( hdr = buf + offset; isspace( (unsigned char) *hdr ); ++hdr ) { ; } if (( hdr = strdup( hdr )) == NULL ) { @@ -249,7 +249,7 @@ read_hdr( FILE *fp, int offset, char *buf, int MAXSIZEe, char **linep ) while ( 1 ) { *linep = fgets( buf, MAXSIZE, fp ); buf[ strlen( buf ) - 1 ] = '\0'; /* remove trailing newline */ - if ( *linep == NULL || !isspace( **linep )) { + if ( *linep == NULL || !isspace( (unsigned char) **linep )) { break; } if (( hdr = realloc( hdr, strlen( hdr ) + @@ -355,16 +355,16 @@ find_command( char *text, char **argp ) p = text; for ( s = argbuf; *p != '\0'; ++p ) { - *s++ = TOLOWER( *p ); + *s++ = TOLOWER( (unsigned char) *p ); } *s = '\0'; for ( i = 0; cmds[ i ].cmd_text != NULL; ++i ) { if (( s = strstr( argbuf, cmds[ i ].cmd_text )) != NULL - && isspace( *(s + strlen( cmds[ i ].cmd_text )))) { + && isspace( (unsigned char) s[ strlen( cmds[ i ].cmd_text ) ] )) { strcpy( argbuf, text + (s - argbuf) + strlen( cmds[ i ].cmd_text )); *argp = argbuf; - while ( isspace( **argp )) { + while ( isspace( (unsigned char) **argp )) { ++(*argp); } return( i ); diff --git a/clients/rcpt500/query.c b/clients/rcpt500/query.c index e70a224ec0..f9675ba470 100644 --- a/clients/rcpt500/query.c +++ b/clients/rcpt500/query.c @@ -263,7 +263,7 @@ append_entry_list( char *reply, char *query, LDAP *ldp, LDAPMessage *ldmsgp ) if (( cn = ldap_get_values( ldp, e, "cn" )) != NULL ) { for ( i = 0; cn[i] != NULL; i++ ) { - if ( isdigit( *( cn[i] + strlen( cn[i] ) - 1 ))) { + if ( isdigit((unsigned char) cn[i][strlen( cn[i] ) - 1])) { rdn = strdup( cn[i] ); free_rdn = 1; break; @@ -330,7 +330,7 @@ remove_trailing_space( char *s ) { char *p = s + strlen( s ) - 1; - while ( isspace( *p ) && p > s ) { + while ( isspace( (unsigned char) *p ) && p > s ) { --p; } *(++p) = '\0'; diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index 4b5ac118ab..fce920e183 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -225,7 +225,7 @@ main( int argc, char **argv ) if ( !use_ldif && ( q = strchr( rbuf, '\n' )) != NULL ) { for ( p = rbuf; p < q; ++p ) { - if ( !isdigit( *p )) { + if ( !isdigit( (unsigned char) *p )) { break; } } @@ -466,20 +466,21 @@ process_ldapmod_rec( char *rbuf ) value = p; } - for ( attr = line; *attr != '\0' && isspace( *attr ); ++attr ) { + for ( attr = line; + *attr != '\0' && isspace( (unsigned char) *attr ); ++attr ) { ; /* skip attribute leading white space */ } - for ( q = p - 1; q > attr && isspace( *q ); --q ) { + for ( q = p - 1; q > attr && isspace( (unsigned char) *q ); --q ) { *q = '\0'; /* remove attribute trailing white space */ } if ( value != NULL ) { - while ( isspace( *value )) { + while ( isspace( (unsigned char) *value )) { ++value; /* skip value leading white space */ } for ( q = value + strlen( value ) - 1; q > value && - isspace( *q ); --q ) { + isspace( (unsigned char) *q ); --q ) { *q = '\0'; /* remove value trailing white space */ } if ( *value == '\0' ) { diff --git a/clients/ud/auth.c b/clients/ud/auth.c index a4f5b60671..ec1af8d5fb 100644 --- a/clients/ud/auth.c +++ b/clients/ud/auth.c @@ -299,7 +299,7 @@ str2upper( char *s ) char *p; for ( p = s; *p != '\0'; ++p ) { - *p = TOUPPER( *p ); + *p = TOUPPER( (unsigned char) *p ); } } @@ -364,7 +364,7 @@ krbgetpass( char *user, char *inst, char *realm, char *pw, C_Block key ) #ifdef HAVE_AFS_KERBEROS strcpy( lcrealm, realm ); for ( p = lcrealm; *p != '\0'; ++p ) { - *p = TOLOWER( *p ); + *p = TOLOWER( (unsigned char) *p ); } ka_StringToKey( passwd, lcrealm, key ); diff --git a/clients/ud/edit.c b/clients/ud/edit.c index 891f2e7c87..8bdab14f9d 100644 --- a/clients/ud/edit.c +++ b/clients/ud/edit.c @@ -265,8 +265,8 @@ write_entry( void ) cp = line; if (*cp == '#') continue; - if (isspace(*cp)) { /* value */ - while (isspace(*cp)) + if (isspace((unsigned char)*cp)) { /* value */ + while (isspace((unsigned char)*cp)) cp++; values[number_of_values++] = strdup(cp); if ( number_of_values >= MAX_VALUES ) { @@ -276,7 +276,7 @@ write_entry( void ) continue; } /* attribute */ - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; /* * If the number of values is greater than zero, then we diff --git a/clients/ud/group.c b/clients/ud/group.c index be5a923267..d58dd020b8 100644 --- a/clients/ud/group.c +++ b/clients/ud/group.c @@ -873,7 +873,7 @@ mod_addrDN( char *group, int offset ) char *cp; if (strchr(s, '<') == NULL) { for (cp = s; *cp != '@'; cp++) - if (isspace(*cp)) + if (isspace((unsigned char)*cp)) *cp = '.'; } new_value = s; diff --git a/clients/ud/main.c b/clients/ud/main.c index ebbe0b46d1..75d8fede0d 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -194,19 +194,19 @@ do_commands( void ) putchar('\n'); continue; } - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; ap = cmd; if (memset(cmd, '\0', sizeof(cmd)) == NULL) fatal("memset"); - while (!isspace(*cp) && (*cp != '\0')) + while (!isspace((unsigned char)*cp) && (*cp != '\0')) *ap++ = *cp++; if (iscom("status")) status(); else if (iscom("stop") || iscom("quit")) break; else if (iscom("cb") || iscom("cd") || iscom("moveto")) { - while (isspace(*cp) && (*cp != '\0')) + while (isspace((unsigned char)*cp) && (*cp != '\0')) cp++; if (!strncasecmp(cp, "base", 4)) cp += 4; @@ -402,7 +402,7 @@ change_base( int type, char **base, char *s ) * * sequence now that 'cp' is pointing to the '='. */ - while(!isspace(*cp)) + while(!isspace((unsigned char)*cp)) cp--; cp++; /* @@ -601,7 +601,7 @@ initialize_client( void ) if (server != NULL) continue; cp = buffer + 6; - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; if ((*cp == '\0') || (*cp == '\n')) continue; @@ -611,7 +611,7 @@ initialize_client( void ) if (server != NULL) continue; cp = buffer + 4; - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; if ((*cp == '\0') || (*cp == '\n')) continue; @@ -619,7 +619,7 @@ initialize_client( void ) } else if (!strncasecmp(buffer, "base", 4)) { cp = buffer + 4; - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; if ((*cp == '\0') || (*cp == '\n')) continue; @@ -627,7 +627,7 @@ initialize_client( void ) } else if (!strncasecmp(buffer, "groupbase", 9)) { cp = buffer + 9; - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; if ((*cp == '\0') || (*cp == '\n')) continue; diff --git a/clients/ud/mod.c b/clients/ud/mod.c index 063c04ac6b..b0539ba79f 100644 --- a/clients/ud/mod.c +++ b/clients/ud/mod.c @@ -574,7 +574,7 @@ set_boolean( printf(" Please enter Y for yes, N for no, or RETURN to cancel: "); fflush(stdout); (void) fetch_buffer(response, sizeof(response), stdin); - for (s = response; isspace(*s); s++) + for (s = response; isspace((unsigned char)*s); s++) ; if ((*s == 'y') || (*s == 'Y')) { if (ldap_modify_s(ld, who, mods)) { @@ -639,7 +639,7 @@ set_updates( char *who, int dummy ) printf("\n Change this setting [no]? "); fflush(stdout); (void) fetch_buffer(response, sizeof(response), stdin); - for (s = response; isspace(*s); s++) + for (s = response; isspace((unsigned char)*s); s++) ; if ((*s == 'y') || (*s == 'Y')) { if (!strcmp(cp, "TRUE")) @@ -770,7 +770,7 @@ check_URL( char *url ) register char *cp; for (cp = url; *cp != '\n' && *cp != '\0'; cp++) { - if (isspace(*cp)) + if (isspace((unsigned char)*cp)) return(-1); /*NOTREACHED*/ } diff --git a/clients/ud/print.c b/clients/ud/print.c index aca1c30f37..de0a946a90 100644 --- a/clients/ud/print.c +++ b/clients/ud/print.c @@ -345,7 +345,7 @@ print_values( struct attribute A ) putchar('\n'); for (k = lead; k > 0; k--) putchar(' '); - while (isspace(*(cp + 1))) + while (isspace((unsigned char) cp[1])) cp++; } else @@ -516,14 +516,14 @@ print_one_URL( char *s, int label_lead, char *tag, int url_lead ) register int i; char c, *cp, *url; - for (cp = s; !isspace(*cp) && (*cp != '\0'); cp++) + for (cp = s; !isspace((unsigned char)*cp) && (*cp != '\0'); cp++) ; c = *cp; *cp = '\0'; url = strdup(s); *cp = c; if (*cp != '\0') { - for (cp++; isspace(*cp); cp++) + for (cp++; isspace((unsigned char)*cp); cp++) ; } else @@ -551,7 +551,7 @@ time2text( char *ldtimestr, int dateonly ) } for ( p = ldtimestr; p - ldtimestr < 12; ++p ) { - if ( !isdigit( *p )) { + if ( !isdigit( (unsigned char) *p )) { return( fmterr ); } } diff --git a/clients/ud/ud.h b/clients/ud/ud.h index ab893e3a25..a90765f6e8 100644 --- a/clients/ud/ud.h +++ b/clients/ud/ud.h @@ -28,7 +28,7 @@ * parsing names. */ #define MAX_NAME_COMPS 8 -#define isnamesepartor(x) (isspace(x)) +#define isnamesepartor(x) (isspace((unsigned char) (x))) #define isignorechar(x) (((x) == '.') || ((x) == '_')) /* diff --git a/clients/ud/util.c b/clients/ud/util.c index c50a60cd76..8371c3e867 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -198,12 +198,13 @@ fetch_buffer( char *buffer, int length, FILE *where ) errno = 0; /* so fatal() doesn't bitch */ fatal("fgets"); } - for (i = strlen(buffer) - 1; i >= 0 && !isprint(buffer[i]); i--) + for (i = strlen(buffer) - 1; + i >= 0 && !isprint((unsigned char) buffer[i]); i--) buffer[i] = '\0'; p = buffer; while ( *p != '\0' ) { - if ( isprint( *p )) { + if ( isprint( (unsigned char) *p )) { ++p; } else { SAFEMEMCPY( p, p + 1, strlen( p + 1 ) + 1 ); @@ -289,10 +290,10 @@ format( char *str, int width, int lead ) /*NOTREACHED*/ } cp = s + width - lead; - while (!isspace(*cp) && (cp != s)) + while (!isspace((unsigned char)*cp) && (cp != s)) cp--; *cp = '\0'; - while (isspace(*s)) + while (isspace((unsigned char)*s)) s++; printf("%s%s\n", leader, s); s = cp + 1; @@ -368,7 +369,7 @@ format2( * back it up to the first space character. */ cp = s + width - first_indent - strlen(first_tag); - while (!isspace(*cp) && (cp != s)) + while (!isspace((unsigned char)*cp) && (cp != s)) cp--; /* @@ -386,7 +387,7 @@ format2( * as well. We should gobble up all of these since we don't want * unexpected leading blanks. */ - for (s = cp + 1; isspace(*s); s++) + for (s = cp + 1; isspace((unsigned char)*s); s++) ; /* now do all of the other lines */ @@ -399,7 +400,7 @@ format2( /*NOTREACHED*/ } cp = s + width - indent - strlen(tag); - while (!isspace(*cp) && (cp != s)) + while (!isspace((unsigned char)*cp) && (cp != s)) cp--; c = *cp; *cp = '\0'; @@ -496,10 +497,10 @@ isauniqname( char *s ) if ((i < 3) || (i > 8)) /* uniqnames are 3-8 chars */ return(FALSE); - if (!isalpha(*s)) /* uniqnames begin with a letter */ + if (!isalpha((unsigned char)*s)) /* uniqnames begin with a letter */ return(FALSE); for ( ; *s != '\0'; s++) /* uniqnames are alphanumeric */ - if (!isalnum(*s)) + if (!isalnum((unsigned char)*s)) return(FALSE); return(TRUE); } @@ -593,7 +594,7 @@ Free( void *ptr ) char * nextstr( char *s ) { - while (isspace(*s) && (*s != '\0')) + while (isspace((unsigned char) *s) && (*s != '\0')) s++; if (s == NULL) return(NULL); diff --git a/contrib/saucer/main.c b/contrib/saucer/main.c index b664c5a10f..3e21106953 100644 --- a/contrib/saucer/main.c +++ b/contrib/saucer/main.c @@ -532,7 +532,7 @@ int is_whitespace(register char *s) if (!s) return 1; - while (*s && isspace(*s)) + while (*s && isspace((unsigned char) *s)) ++s; return !*s; @@ -634,7 +634,7 @@ char *skip_to_whitespace(register char *s) if (!s) return s; - while (*s && !isspace(*s)) + while (*s && !isspace((unsigned char) *s)) ++s; return s; @@ -645,7 +645,7 @@ char *skip_whitespace(register char *s) if (!s) return s; - while (*s && isspace(*s)) + while (*s && isspace((unsigned char) *s)) ++s; return s; diff --git a/contrib/web_ldap/util.c b/contrib/web_ldap/util.c index f120efbba7..d76f304ecb 100644 --- a/contrib/web_ldap/util.c +++ b/contrib/web_ldap/util.c @@ -279,7 +279,7 @@ char* lower_case_string(char* inputbuf) while(inputbuf[pos]) { - inputbuf[pos] = (char)tolower(inputbuf[pos]); + inputbuf[pos] = (char)tolower((unsigned char) inputbuf[pos]); pos++; } return(inputbuf); @@ -295,7 +295,7 @@ char* upper_case_string(char* inputbuf) while(inputbuf[pos]) { - inputbuf[pos] = (char)toupper(inputbuf[pos]); + inputbuf[pos] = (char)toupper((unsigned char) inputbuf[pos]); pos++; } return(inputbuf); @@ -420,7 +420,7 @@ long unformat_cost(char* cost) { if(*spos == '.') break; - if(isdigit(*spos)) + if(isdigit((unsigned char) *spos)) *dpos++ = *spos; spos++; if(buf_siz++ == 98) /* make sure we don't overrun buf */ @@ -440,7 +440,7 @@ int digits_only(char* str) pos = str; while(*pos) { - if(!isdigit(*pos)) + if(!isdigit((unsigned char) *pos)) return(0); /* non-digit found */ pos++; } diff --git a/contrib/web_ldap/web_ldap.c b/contrib/web_ldap/web_ldap.c index f08cd6b9e0..b6fa2e10c1 100644 --- a/contrib/web_ldap/web_ldap.c +++ b/contrib/web_ldap/web_ldap.c @@ -558,7 +558,7 @@ void upcase_string(char *array, char *uparray) { int i; for (i=0; i < strlen(array); i++) { - uparray[i] = toupper(array[i]); + uparray[i] = toupper((unsigned char) array[i]); uparray[i + 1] = 0; } return; diff --git a/contrib/whois++/command.c b/contrib/whois++/command.c index 1b109ae65c..638442e897 100644 --- a/contrib/whois++/command.c +++ b/contrib/whois++/command.c @@ -88,7 +88,7 @@ getToken( char *token ) if ( log ) syslog( LOG_INFO, "Whois++ Query: %s", buffer ); } - while ( buffer[idx] != '\0' && isspace( buffer[idx] ) ) + while ( buffer[idx] != '\0' && isspace( (unsigned char) buffer[idx] ) ) idx++; token[0] = buffer[idx++]; token[1] = '\0'; @@ -154,7 +154,8 @@ getToken( char *token ) token[i++] = buffer[idx++]; else token[i++] = ch; - } while ( ch != '\0' && !isspace( ch ) && !isspecial( ch ) ); + } while ( ch != '\0' && + !isspace( (unsigned char) ch ) && !isspecial( ch ) ); token[--i] = '\0'; idx--; /**/ /* @@ -376,7 +377,7 @@ processTerm( } else { if ( ( s = strchr( buffer, ',' ) ) != NULL ) { *s++ = '\0'; - while ( *s && isspace( *s ) ) + while ( *s && isspace( (unsigned char) *s ) ) s++; sprintf( query, "(sn%s%s)", (soundex)?"~=":"=", buffer ); @@ -384,7 +385,7 @@ processTerm( /* let's just make sure there is no title */ if ( ( t = strrchr( s, ',' ) ) != NULL ) { *t++ = '\0'; - while ( *t && isspace( *t ) ) + while ( *t && isspace( (unsigned char) *t ) ) t++; sprintf( query, "(personalTitle%s%s)", (soundex)?"~=":"=", t ); diff --git a/contrib/whois++/output.c b/contrib/whois++/output.c index 6ebe649227..b793971e62 100644 --- a/contrib/whois++/output.c +++ b/contrib/whois++/output.c @@ -217,18 +217,18 @@ char *dn, *attributes[]; ufn = ldap_dn2ufn( dn ); if ( ( s = index( ufn, ',' ) ) != NULL ) { *s++ = '\0'; - while ( *s != '\0' && isspace( *s ) ) + while ( *s != '\0' && isspace( (unsigned char) *s ) ) s++; department = s; while ( s != NULL && *s != '\0' && !EQ( s, organisation ) ) if ( ( s = index( s, ',' ) ) != NULL ) { s++; - while ( *s != '\0' && isspace( *s ) ) + while ( *s && isspace( (unsigned char) *s ) ) s++; } if ( s != NULL ) if ( s != department ) { - while ( isspace( *--s ) ) + while ( isspace( (unsigned char) *--s ) ) ; *s = '\0'; } else diff --git a/contrib/whois++/util.c b/contrib/whois++/util.c index 5d7b8ebec4..3f9bdd668b 100644 --- a/contrib/whois++/util.c +++ b/contrib/whois++/util.c @@ -53,8 +53,8 @@ lowerCase( char *string ) char *s; for ( s = string; s != NULL && *s != '\0'; s++ ) - if ( isupper( *s ) ) - *s = tolower( *s ); + if ( isupper( (unsigned char) *s ) ) + *s = tolower( (unsigned char) *s ); return string; } diff --git a/libraries/libldap/dsparse.c b/libraries/libldap/dsparse.c index 139d9a610e..9e1f1fbdcd 100644 --- a/libraries/libldap/dsparse.c +++ b/libraries/libldap/dsparse.c @@ -155,7 +155,7 @@ next_token( char **sp ) p = *sp; - while ( isspace( *p )) { /* skip leading white space */ + while ( isspace( (unsigned char) *p )) { /* skip leading white space */ ++p; } @@ -170,7 +170,7 @@ next_token( char **sp ) t = tokstart = p; for ( ;; ) { - if ( *p == '\0' || ( isspace( *p ) && !in_quote )) { + if ( *p == '\0' || ( isspace( (unsigned char) *p ) && !in_quote )) { if ( *p != '\0' ) { ++p; } diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index 28b5d554bf..fd229f2247 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -92,8 +92,8 @@ ldap_dn2ufn( char *dn ) char *rsave = r; *r-- = '\0'; - while ( !isspace( *r ) && *r != ';' - && *r != ',' && r > ufn ) + while ( !isspace( (unsigned char) *r ) + && *r != ';' && *r != ',' && r > ufn ) r--; r++; diff --git a/libraries/libldap/getdxbyname.c b/libraries/libldap/getdxbyname.c index af03dd5e7d..b6627cee98 100644 --- a/libraries/libldap/getdxbyname.c +++ b/libraries/libldap/getdxbyname.c @@ -131,12 +131,12 @@ decode_answer( unsigned char *answer, int len ) if ( *q >= 3 && strncasecmp( q + 1, "dx:", 3 ) == 0 ) { txt_len = *q - 3; r = q + 4; - while ( isspace( *r )) { + while ( isspace( (unsigned char) *r )) { ++r; --txt_len; } pref = 0; - while ( isdigit( *r )) { + while ( isdigit( (unsigned char) *r )) { pref *= 10; pref += ( *r - '0' ); ++r; @@ -145,7 +145,7 @@ decode_answer( unsigned char *answer, int len ) if ( dx_count < MAX_TO_SORT - 1 ) { dx_pref[ dx_count ] = pref; } - while ( isspace( *r )) { + while ( isspace( (unsigned char) *r )) { ++r; --txt_len; } diff --git a/libraries/libldap/getfilter.c b/libraries/libldap/getfilter.c index 5be8726f64..d69ff0e9e8 100644 --- a/libraries/libldap/getfilter.c +++ b/libraries/libldap/getfilter.c @@ -331,12 +331,12 @@ ldap_build_filter( char *filtbuf, unsigned long buflen, char *pattern, if ( *p == '%' ) { ++p; if ( *p == 'v' ) { - if ( isdigit( *(p+1))) { + if ( isdigit( (unsigned char) p[1] )) { ++p; wordnum = *p - '1'; if ( *(p+1) == '-' ) { ++p; - if ( isdigit( *(p+1))) { + if ( isdigit( (unsigned char) p[1] )) { ++p; endwordnum = *p - '1'; /* e.g., "%v2-4" */ if ( endwordnum > wordcount - 1 ) { diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c index 3da4d7bf4b..ae298ff23d 100644 --- a/libraries/libldap/init.c +++ b/libraries/libldap/init.c @@ -92,14 +92,15 @@ static void openldap_ldap_init_w_conf(const char *file) if(*start == '#') continue; /* trim leading white space */ - while((*start != '\0') && isspace(*start)) start++; + while((*start != '\0') && isspace((unsigned char) *start)) + start++; /* anything left? */ if(*start == '\0') continue; /* trim trailing white space */ end = &start[strlen(start)-1]; - while(isspace(*end)) end--; + while(isspace((unsigned char)*end)) end--; end[1] = '\0'; /* anything left? */ @@ -108,7 +109,7 @@ static void openldap_ldap_init_w_conf(const char *file) /* parse the command */ cmd=start; - while((*start != '\0') && !isspace(*start)) { + while((*start != '\0') && !isspace((unsigned char)*start)) { start++; } if(*start == '\0') { @@ -119,7 +120,7 @@ static void openldap_ldap_init_w_conf(const char *file) *start++ = '\0'; /* we must have some non-whitespace to skip */ - while(isspace(*start)) start++; + while(isspace((unsigned char)*start)) start++; opt = start; for(i=0; attrs[i].type != ATTR_NONE; i++) { diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index 4aa78fb4f2..171641e30f 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -404,7 +404,7 @@ put_filter_list( BerElement *ber, char *str ) Debug( LDAP_DEBUG_TRACE, "put_filter_list \"%s\"\n", str, 0, 0 ); while ( *str ) { - while ( *str && isspace( *str ) ) + while ( *str && isspace( (unsigned char) *str ) ) str++; if ( *str == '\0' ) break; diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index 16331811cd..e603e2009b 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -256,7 +256,7 @@ do_entry2text( freevals = 1; } - *attr = TOUPPER( *attr ); + *attr = TOUPPER( (unsigned char) *attr ); err = do_vals2text( ld, buf, vals, attr, labelwidth, LDAP_SYN_CASEIGNORESTR, writeproc, writeparm, eol, @@ -309,14 +309,14 @@ do_entry2text( if ( show && LDAP_GET_SYN_TYPE( colp->ti_syntaxid ) == LDAP_SYN_TYPE_BOOLEAN && LDAP_IS_TMPLITEM_OPTION_SET( colp, LDAP_DITEM_OPT_HIDEIFFALSE ) && - TOUPPER( vals[ 0 ][ 0 ] ) != 'T' ) { + TOUPPER( (unsigned char) vals[ 0 ][ 0 ] ) != 'T' ) { show = 0; } if ( colp->ti_syntaxid == LDAP_SYN_SEARCHACTION ) { if (( opts & LDAP_DISP_OPT_DOSEARCHACTIONS ) != 0 ) { if ( colp->ti_attrname == NULL || ( show && - TOUPPER( vals[ 0 ][ 0 ] ) == 'T' )) { + TOUPPER( (unsigned char) vals[ 0 ][ 0 ] ) == 'T' )) { err = searchaction( ld, buf, base, entry, dn, colp, labelwidth, rdncount, writeproc, writeparm, eol, urlprefix ); @@ -680,7 +680,7 @@ do_vals2text( p = s = outval; while (( s = strchr( s, '$' )) != NULL ) { *s++ = '\0'; - while ( isspace( *s )) { + while ( isspace( (unsigned char) *s )) { ++s; } if ( html ) { @@ -696,7 +696,7 @@ do_vals2text( break; case LDAP_SYN_BOOLEAN: - outval = TOUPPER( outval[ 0 ] ) == 'T' ? "TRUE" : "FALSE"; + outval = TOUPPER((unsigned char) outval[0]) == 'T' ? "TRUE" : "FALSE"; ++writeoutval; break; @@ -709,13 +709,13 @@ do_vals2text( case LDAP_SYN_LABELEDURL: if ( !notascii && ( p = strchr( outval, '$' )) != NULL ) { *p++ = '\0'; - while ( isspace( *p )) { + while ( isspace( (unsigned char) *p )) { ++p; } s = outval; } else if ( !notascii && ( s = strchr( outval, ' ' )) != NULL ) { *s++ = '\0'; - while ( isspace( *s )) { + while ( isspace( (unsigned char) *s )) { ++s; } p = outval; @@ -889,7 +889,7 @@ time2text( char *ldtimestr, int dateonly ) return( fmterr ); } - for ( ndigits=0; isdigit(ldtimestr[ndigits]); ndigits++) { + for ( ndigits=0; isdigit((unsigned char) ldtimestr[ndigits]); ndigits++) { ; /* EMPTY */ } diff --git a/libraries/libldif/line64.c b/libraries/libldif/line64.c index b4f8968e74..d0af5ae29b 100644 --- a/libraries/libldif/line64.c +++ b/libraries/libldif/line64.c @@ -62,7 +62,7 @@ ldif_parse_line( int i, b64; /* skip any leading space */ - while ( isspace( *line ) ) { + while ( isspace( (unsigned char) *line ) ) { line++; } *type = line; @@ -76,7 +76,7 @@ ldif_parse_line( } /* trim any space between type and : */ - for ( p = s - 1; p > line && isspace( *p ); p-- ) { + for ( p = s - 1; p > line && isspace( (unsigned char) *p ); p-- ) { *p = '\0'; } *s++ = '\0'; @@ -92,7 +92,7 @@ ldif_parse_line( } /* skip space between : and value */ - while ( isspace( *s ) ) { + while ( isspace( (unsigned char) *s ) ) { s++; } @@ -175,8 +175,7 @@ ldif_parse_line( char * ldif_getline( char **next ) { - char *l; - char c; + char *l; if ( *next == NULL || **next == '\n' || **next == '\0' ) { return( NULL ); @@ -184,7 +183,7 @@ ldif_getline( char **next ) l = *next; while ( (*next = strchr( *next, '\n' )) != NULL ) { - c = *(*next + 1); + unsigned char c = *(*next + 1); if ( isspace( c ) && c != '\n' ) { **next = CONTINUED_LINE_MARKER; *(*next+1) = CONTINUED_LINE_MARKER; diff --git a/servers/ldapd/syntax.c b/servers/ldapd/syntax.c index 955ce71734..7035991b4e 100644 --- a/servers/ldapd/syntax.c +++ b/servers/ldapd/syntax.c @@ -147,7 +147,7 @@ attr_key_rfc1779( if ( x == NULL ) { x = "?"; - } else if ( isdigit ( *x ) ) { + } else if ( isdigit ( (unsigned char) *x ) ) { sprintf ( key, "OID.%s", x ); return; } else if (strcasecmp(x,"commonName")==0) { @@ -788,7 +788,8 @@ static void de_t61( char *s, int t61mark ) { char *next = s; - int c, hex; + unsigned char c; + unsigned int hex; while ( *s ) { switch ( *s ) { diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 57ef5ce587..b3741a0b70 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -243,7 +243,7 @@ parse_acl( /* normalize the domain */ for ( s = b->a_domainpat; *s; s++ ) { - *s = TOLOWER( *s ); + *s = TOLOWER( (unsigned char) *s ); } } else if ( strcasecmp( left, "addr" ) == 0 ) { regtest(fname, lineno, right); diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 0d696dc024..6467a13f05 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -40,7 +40,7 @@ attr_normalize( char *s ) char *save; for ( save = s; *s; s++ ) { - *s = TOLOWER( *s ); + *s = TOLOWER( (unsigned char) *s ); } return( save ); diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 6217025a8a..03d69e750e 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -623,7 +623,7 @@ fp_getline( FILE *fp, int *lineno ) if ( (p = strchr( buf, '\n' )) != NULL ) { *p = '\0'; } - if ( ! isspace( buf[0] ) ) { + if ( ! isspace( (unsigned char) buf[0] ) ) { return( line ); } diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index eaaab2dfd1..230d672edb 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -250,7 +250,7 @@ slapd_daemon( /* normalize the domain */ for ( s = client_name; *s; s++ ) { - *s = TOLOWER( *s ); + *s = TOLOWER( (unsigned char) *s ); } } else { diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index cac66133e1..4c90566e7f 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -138,7 +138,7 @@ dn_normalize_case( char *dn ) /* normalize case */ for ( s = dn; *s; s++ ) { - *s = TOUPPER( *s ); + *s = TOUPPER( (unsigned char) *s ); } return( dn ); @@ -337,7 +337,7 @@ dn_upcase( char *dn ) /* normalize case */ for ( s = dn; *s; s++ ) { - *s = TOUPPER( *s ); + *s = TOUPPER( (unsigned char) *s ); } return( dn ); diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index 7e2a0b389d..61f315a507 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -49,7 +49,7 @@ str2entry( char *s ) /* check to see if there's an id included */ next = s; - if ( isdigit( *s ) ) { + if ( isdigit( (unsigned char) *s ) ) { id = atoi( s ); if ( (s = ldif_getline( &next )) == NULL ) { Debug( LDAP_DEBUG_TRACE, diff --git a/servers/slapd/phonetic.c b/servers/slapd/phonetic.c index 4c7f3537bf..27f3f91e54 100644 --- a/servers/slapd/phonetic.c +++ b/servers/slapd/phonetic.c @@ -97,11 +97,11 @@ phonetic( char *s ) } adjacent = '0'; - phoneme[0] = TOUPPER(*p); + phoneme[0] = TOUPPER((unsigned char)*p); phoneme[1] = '\0'; for ( i = 0; i < 99 && (! iswordbreak(*p)); p++ ) { - ch = TOUPPER (*p); + ch = TOUPPER ((unsigned char)*p); code = '0'; @@ -199,8 +199,8 @@ phonetic( char *Word ) for (n = ntrans + 4, n_end = ntrans + 35; !iswordbreak( *Word ) && n < n_end; Word++) { - if (isalpha(*Word)) - *n++ = TOUPPER(*Word); + if (isalpha((unsigned char)*Word)) + *n++ = TOUPPER((unsigned char)*Word); } Metaph = buf; *Metaph = '\0'; diff --git a/servers/slapd/repl.c b/servers/slapd/repl.c index c1bcff91d5..64d3daade4 100644 --- a/servers/slapd/repl.c +++ b/servers/slapd/repl.c @@ -96,7 +96,7 @@ replog( tmp = entry2str( e, &len, 0 ); while ( (tmp = strchr( tmp, '\n' )) != NULL ) { tmp++; - if ( ! isspace( *tmp ) ) + if ( ! isspace( (unsigned char) *tmp ) ) break; } fprintf( fp, "%s", tmp ); diff --git a/servers/slapd/shell-backends/shellutil.c b/servers/slapd/shell-backends/shellutil.c index 59d43cb707..8fb7ddea44 100644 --- a/servers/slapd/shell-backends/shellutil.c +++ b/servers/slapd/shell-backends/shellutil.c @@ -198,7 +198,7 @@ parse_input( FILE *ifp, FILE *ofp, struct ldop *op ) while ( args != NULL ) { if (( p = strchr( args, ' ' )) != NULL ) { *p++ = '\0'; - while ( isspace( *p )) { + while ( isspace( (unsigned char) *p )) { ++p; } } @@ -233,7 +233,7 @@ find_input_tag( char **linep ) /* linep is set to start of args */ for ( i = 0; ips[ i ].ip_type != 0; ++i ) { if ( strncasecmp( *linep, ips[ i ].ip_tag, p - *linep ) == 0 ) { - while ( isspace( *(++p) )) { + while ( isspace( (unsigned char) *(++p) )) { ; } *linep = p; diff --git a/servers/slapd/str2filter.c b/servers/slapd/str2filter.c index 1ab28f1462..3fce185f77 100644 --- a/servers/slapd/str2filter.c +++ b/servers/slapd/str2filter.c @@ -101,7 +101,7 @@ str2list( char *str, unsigned long ftype ) fp = &f->f_list; while ( *str ) { - while ( *str && isspace( *str ) ) + while ( *str && isspace( (unsigned char) *str ) ) str++; if ( *str == '\0' ) break; diff --git a/servers/slapd/tools/chlog2replog.c b/servers/slapd/tools/chlog2replog.c index b9d171ba8e..4349779914 100644 --- a/servers/slapd/tools/chlog2replog.c +++ b/servers/slapd/tools/chlog2replog.c @@ -232,7 +232,8 @@ static void de_t61(char *s, int t61mark) { char *next = s; - int c, hex; + unsigned char c; + unsigned int hex; while ( *s ) { switch ( *s ) { @@ -533,7 +534,8 @@ main( int argc, char **argv ) /* See if we've got a line continuation to deal with */ nbuflen = strlen( nbuf ); if ( state == ST_CONCAT ) { - for ( p = nbuf; isspace( *p ); p++, nbuflen-- ); /* skip space */ + for ( p = nbuf; isspace( (unsigned char) *p ); p++, nbuflen-- ) + ; /* skip space */ buf = realloc( buf, buflen + nbuflen + 1 ); strcat( buf, p ); buflen += ( nbuflen ); diff --git a/servers/slapd/tools/edb2ldif.c b/servers/slapd/tools/edb2ldif.c index 9aad796369..bef4a0d8c7 100644 --- a/servers/slapd/tools/edb2ldif.c +++ b/servers/slapd/tools/edb2ldif.c @@ -761,7 +761,7 @@ read_edbmap( char *mapfile, struct edbmap **edbmapp ) } *filename++ = '\0'; - while ( isspace( *filename )) { /* strip leading whitespace */ + while ( isspace((unsigned char) *filename) ) { /* strip leading whitespace */ ++filename; } @@ -770,12 +770,12 @@ read_edbmap( char *mapfile, struct edbmap **edbmapp ) } p = filename + strlen( filename ) - 1; - while ( isspace( *p )) { /* strip trailing whitespace */ + while ( isspace((unsigned char) *p) ) { /* strip trailing whitespace */ *p-- = '\0'; } rdn = line; - while ( isspace( *rdn )) { /* strip leading whitespace */ + while ( isspace((unsigned char) *rdn)) { /* strip leading whitespace */ ++rdn; } @@ -784,7 +784,7 @@ read_edbmap( char *mapfile, struct edbmap **edbmapp ) } p = rdn + strlen( rdn ) - 1; - while ( isspace( *p )) { /* strip trailing whitespace */ + while ( isspace((unsigned char) *p)) { /* strip trailing whitespace */ *p-- = '\0'; } diff --git a/servers/slapd/tools/ldapsyntax.c b/servers/slapd/tools/ldapsyntax.c index 2495e4db22..2d916e254d 100644 --- a/servers/slapd/tools/ldapsyntax.c +++ b/servers/slapd/tools/ldapsyntax.c @@ -248,7 +248,8 @@ char *s; int t61mark; { char *next = s; - int c, hex; + unsigned char c; + unsigned int hex; while ( *s ) { switch ( *s ) { diff --git a/servers/slapd/tools/ldbmcat.c b/servers/slapd/tools/ldbmcat.c index f7e62c7d31..fb3cbdd137 100644 --- a/servers/slapd/tools/ldbmcat.c +++ b/servers/slapd/tools/ldbmcat.c @@ -66,7 +66,7 @@ main( int argc, char **argv ) if (( s = data.dptr ) != NULL ) { - if ( !printid && isdigit( *s )) { + if ( !printid && isdigit( (unsigned char) *s )) { if (( s = strchr( s, '\n' )) != NULL ) { ++s; } diff --git a/servers/slapd/tools/ldbmtest.c b/servers/slapd/tools/ldbmtest.c index f2e33a7610..78dcf8f915 100644 --- a/servers/slapd/tools/ldbmtest.c +++ b/servers/slapd/tools/ldbmtest.c @@ -436,7 +436,7 @@ get_idlist( FILE *fp, Datum *data ) printf( "%d IDs entered. Max number of ids? [%d] ", i, i ); if ( fgets( buf, sizeof(buf), fp ) != NULL && - isdigit( buf[0] ) ) { + isdigit( (unsigned char) buf[0] ) ) { nmax = atol( buf ); } } else { diff --git a/servers/slapd/tools/ldif2id2children-bdb2.c b/servers/slapd/tools/ldif2id2children-bdb2.c index 3144339f11..e75c5f47d9 100644 --- a/servers/slapd/tools/ldif2id2children-bdb2.c +++ b/servers/slapd/tools/ldif2id2children-bdb2.c @@ -154,7 +154,7 @@ main( int argc, char **argv ) } if ( line[0] == '\n' || stop && buf && *buf ) { if ( *buf != '\n' ) { - if (isdigit(*buf)) { + if (isdigit((unsigned char) *buf)) { id = atol(buf); } else { id++; diff --git a/servers/slapd/tools/ldif2id2children.c b/servers/slapd/tools/ldif2id2children.c index 186817bcc7..2f26509dcc 100644 --- a/servers/slapd/tools/ldif2id2children.c +++ b/servers/slapd/tools/ldif2id2children.c @@ -154,7 +154,7 @@ main( int argc, char **argv ) } if ( line[0] == '\n' || stop && buf && *buf ) { if ( *buf != '\n' ) { - if (isdigit(*buf)) { + if (isdigit((unsigned char) *buf)) { id = atol(buf); } else { id++; diff --git a/servers/slapd/tools/ldif2id2entry-bdb2.c b/servers/slapd/tools/ldif2id2entry-bdb2.c index 6dec9bd943..38f9b99327 100644 --- a/servers/slapd/tools/ldif2id2entry-bdb2.c +++ b/servers/slapd/tools/ldif2id2entry-bdb2.c @@ -137,7 +137,7 @@ main( int argc, char **argv ) len = strlen( line ); if ( buf == NULL || *buf == '\0' ) { - if (!isdigit(line[0])) { + if (!isdigit((unsigned char) line[0])) { sprintf( idbuf, "%d\n", id + 1 ); idlen = strlen( idbuf ); } else { diff --git a/servers/slapd/tools/ldif2id2entry.c b/servers/slapd/tools/ldif2id2entry.c index 25a9d9ee20..1806df7917 100644 --- a/servers/slapd/tools/ldif2id2entry.c +++ b/servers/slapd/tools/ldif2id2entry.c @@ -137,7 +137,7 @@ main( int argc, char **argv ) len = strlen( line ); if ( buf == NULL || *buf == '\0' ) { - if (!isdigit(line[0])) { + if (!isdigit((unsigned char) line[0])) { sprintf( idbuf, "%d\n", id + 1 ); idlen = strlen( idbuf ); } else { diff --git a/servers/slapd/tools/ldif2index-bdb2.c b/servers/slapd/tools/ldif2index-bdb2.c index ff427aab9e..cedb124bae 100644 --- a/servers/slapd/tools/ldif2index-bdb2.c +++ b/servers/slapd/tools/ldif2index-bdb2.c @@ -140,7 +140,7 @@ main( int argc, char **argv ) } if ( line[0] == '\n' || stop && buf && *buf ) { if ( *buf != '\n' ) { - if (isdigit(*buf)) { + if (isdigit((unsigned char) *buf)) { id = atol(buf); } else { id++; diff --git a/servers/slapd/tools/ldif2index.c b/servers/slapd/tools/ldif2index.c index 6aa24891d7..7032ea63c3 100644 --- a/servers/slapd/tools/ldif2index.c +++ b/servers/slapd/tools/ldif2index.c @@ -140,7 +140,7 @@ main( int argc, char **argv ) } if ( line[0] == '\n' || stop && buf && *buf ) { if ( *buf != '\n' ) { - if (isdigit(*buf)) { + if (isdigit((unsigned char) *buf)) { id = atol(buf); } else { id++; diff --git a/servers/slapd/value.c b/servers/slapd/value.c index bb6b7e620b..d8f72c4cd8 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -98,7 +98,7 @@ value_normalize( if ( (syntax & SYNTAX_TEL) && (*s == ' ' || *s == '-') ) { continue; } - *d++ = TOUPPER( *s ); + *d++ = TOUPPER( (unsigned char) *s ); } *d = '\0'; }