Apply Hallvard's ctype 'unsigned char' fix from -devel.

This commit is contained in:
Kurt Zeilenga 1999-03-02 19:30:02 +00:00
parent 06bcd60dd3
commit b190fca3a9
50 changed files with 133 additions and 125 deletions

View File

@ -3,6 +3,7 @@ OpenLDAP Change Log
Changes included in OpenLDAP 1.2.1
CVS Tag: OPENLDAP_REL_ENG_1_2
Updated ctype and string generic headers.
Fix ctype 'unsigned char' bug
Build environment
Added pthread '-mt' check for Solaris 2.x.

View File

@ -1138,7 +1138,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;
}
@ -1176,7 +1176,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] );
@ -1225,7 +1225,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;
}

View File

@ -191,7 +191,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;
}

View File

@ -228,7 +228,7 @@ do_query( void )
p = buf;
}
for ( ; *p && isspace( *p ); p++ )
for ( ; *p && isspace( (unsigned char) *p ); p++ )
; /* NULL */
do_search( ld, p );
@ -370,7 +370,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;
}

View File

@ -376,7 +376,7 @@ do_queries( int s )
query = buf;
/* strip off leading white space */
while ( isspace( *query )) {
while ( isspace( (unsigned char) *query )) {
++query;
--len;
}

View File

@ -406,7 +406,7 @@ do_queries( int s )
query = buf;
/* strip off leading white space */
while ( isspace( *query )) {
while ( isspace( (unsigned char) *query )) {
++query;
--len;
}

View File

@ -1311,7 +1311,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;
}
@ -1349,7 +1349,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] );
@ -1398,7 +1398,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;
}

View File

@ -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 );

View File

@ -261,7 +261,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;
@ -325,7 +325,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';

View File

@ -211,7 +211,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;
}
}
@ -452,20 +452,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' ) {

View File

@ -298,7 +298,7 @@ str2upper( char *s )
char *p;
for ( p = s; *p != '\0'; ++p ) {
*p = TOUPPER( *p );
*p = TOUPPER( (unsigned char) *p );
}
}
@ -363,7 +363,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 );

View File

@ -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

View File

@ -865,7 +865,7 @@ mod_addrDN( char *group, int offset )
register char *cp;
if (strchr(s, '<') == NULL) {
for (cp = s; *cp != '@'; cp++)
if (isspace(*cp))
if (isspace((unsigned char)*cp))
*cp = '.';
}
new_value = s;

View File

@ -195,19 +195,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;
@ -391,7 +391,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++;
/*
@ -582,7 +582,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;
@ -592,7 +592,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;
@ -600,7 +600,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;
@ -608,7 +608,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;

View File

@ -570,7 +570,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)) {
@ -635,7 +635,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"))
@ -766,7 +766,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*/
}

View File

@ -341,7 +341,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
@ -512,14 +512,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
@ -547,7 +547,7 @@ time2text( char *ldtimestr, int dateonly )
}
for ( p = ldtimestr; p - ldtimestr < 12; ++p ) {
if ( !isdigit( *p )) {
if ( !isdigit( (unsigned char) *p )) {
return( fmterr );
}
}

View File

@ -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) == '_'))
/*

View File

@ -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);

View File

@ -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;

View File

@ -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 );

View File

@ -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

View File

@ -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;
}

View File

@ -157,7 +157,7 @@ next_token( char **sp )
p = *sp;
while ( isspace( *p )) { /* skip leading white space */
while ( isspace( (unsigned char) *p )) { /* skip leading white space */
++p;
}
@ -172,7 +172,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;
}

View File

@ -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++;

View File

@ -133,12 +133,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;
@ -147,7 +147,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;
}

View File

@ -333,12 +333,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 ) {

View File

@ -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++) {

View File

@ -406,7 +406,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;

View File

@ -254,7 +254,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,
@ -303,14 +303,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 );
@ -674,7 +674,7 @@ do_vals2text(
p = s = outval;
while (( s = strchr( s, '$' )) != NULL ) {
*s++ = '\0';
while ( isspace( *s )) {
while ( isspace( (unsigned char) *s )) {
++s;
}
if ( html ) {
@ -690,7 +690,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;
@ -703,13 +703,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;
@ -883,7 +883,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 */
}

View File

@ -60,7 +60,7 @@ str_parse_line(
int i, b64;
/* skip any leading space */
while ( isspace( *line ) ) {
while ( isspace( (unsigned char) *line ) ) {
line++;
}
*type = line;
@ -73,7 +73,7 @@ str_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';
@ -89,7 +89,7 @@ str_parse_line(
}
/* skip space between : and value */
while ( isspace( *s ) ) {
while ( isspace( (unsigned char) *s ) ) {
s++;
}
@ -171,8 +171,7 @@ str_parse_line(
char *
str_getline( char **next )
{
char *l;
char c;
char *l;
if ( *next == NULL || **next == '\n' || **next == '\0' ) {
return( NULL );
@ -180,7 +179,7 @@ str_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;

View File

@ -146,7 +146,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) {
@ -787,7 +787,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 ) {

View File

@ -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);

View File

@ -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 );

View File

@ -579,7 +579,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 );
}

View File

@ -250,7 +250,7 @@ slapd_daemon(
/* normalize the domain */
for ( s = client_name; *s; s++ ) {
*s = TOLOWER( *s );
*s = TOLOWER( (unsigned char) *s );
}
} else {

View File

@ -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 );
@ -266,7 +266,7 @@ dn_upcase( char *dn )
/* normalize case */
for ( s = dn; *s; s++ ) {
*s = TOUPPER( *s );
*s = TOUPPER( (unsigned char) *s );
}
return( dn );

View File

@ -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 = str_getline( &next )) == NULL ) {
Debug( LDAP_DEBUG_TRACE,

View File

@ -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';

View File

@ -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 );

View File

@ -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;

View File

@ -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;

View File

@ -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 );

View File

@ -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';
}

View File

@ -248,7 +248,8 @@ char *s;
int t61mark;
{
char *next = s;
int c, hex;
unsigned char c;
unsigned int hex;
while ( *s ) {
switch ( *s ) {

View File

@ -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;
}

View File

@ -432,7 +432,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 {

View File

@ -152,7 +152,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++;

View File

@ -134,7 +134,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 {

View File

@ -137,7 +137,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++;

View File

@ -98,7 +98,7 @@ value_normalize(
if ( (syntax & SYNTAX_TEL) && (*s == ' ' || *s == '-') ) {
continue;
}
*d++ = TOUPPER( *s );
*d++ = TOUPPER( (unsigned char) *s );
}
*d = '\0';
}