]> git.sur5r.net Git - openldap/commitdiff
Cast ctype.h char arguments to unsigned char
authorHallvard Furuseth <hallvard@openldap.org>
Sat, 1 Apr 2006 23:44:42 +0000 (23:44 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sat, 1 Apr 2006 23:44:42 +0000 (23:44 +0000)
clients/tools/common.c
libraries/libldap/cyrus.c
libraries/libldap/url.c
libraries/liblutil/ldif.c
libraries/liblutil/utils.c
servers/slapd/aclparse.c
servers/slapd/back-bdb/config.c
servers/slapd/back-ldap/config.c
servers/slapd/bconfig.c
servers/slapd/config.c
servers/slapd/main.c

index ac9c300afb03776e3d7de291e09a9d4a36b966ea..613bfb7b1ad87de449d5d884c52c062f50986efb 100644 (file)
@@ -1687,7 +1687,7 @@ tool_is_oid( const char *s )
 {
        int             first = 1;
 
-       if ( !isdigit( s[ 0 ] ) ) {
+       if ( !isdigit( (unsigned char) s[ 0 ] ) ) {
                return 0;
        }
 
@@ -1700,7 +1700,7 @@ tool_is_oid( const char *s )
                        continue;
                }
 
-               if ( !isdigit( s[ 0 ] ) ) {
+               if ( !isdigit( (unsigned char) s[ 0 ] ) ) {
                        return 0;
                }
 
index 296e6337316ddfce5792b6eb65359b4d501e9002..154fe80e57eadb130d265ae012d05756f52f5515 100644 (file)
@@ -1051,7 +1051,8 @@ int ldap_pvt_sasl_secprops(
                        if ( sprops[j].ival ) {
                                unsigned v;
                                char *next = NULL;
-                               if ( !isdigit( props[i][sprops[j].key.bv_len] )) continue;
+                               if ( !isdigit( (unsigned char)props[i][sprops[j].key.bv_len] ))
+                                       continue;
                                v = strtoul( &props[i][sprops[j].key.bv_len], &next, 10 );
                                if ( next == &props[i][sprops[j].key.bv_len] || next[0] != '\0' ) continue;
                                switch( sprops[j].ival ) {
index c86e80e9ab9bc16bddcf429b45934cfeb2764a29..4c27ed33f23c3dcdd40f701a2fa5d9db3c709c52 100644 (file)
@@ -346,7 +346,7 @@ hex_escape_len( const char *s, unsigned list )
                        
                /* RFC 2396: unreserved alphanum */
                default:
-                       if ( !isalnum( s[0] ) ) {
+                       if ( !isalnum( (unsigned char) s[0] ) ) {
                                len += 3;
                        } else {
                                len++;
@@ -411,7 +411,7 @@ hex_escape( char *buf, int len, const char *s, unsigned list )
                        
                /* RFC 2396: unreserved alphanum */
                default:
-                       if ( !isalnum( s[i] ) ) {
+                       if ( !isalnum( (unsigned char) s[i] ) ) {
                                escape = 1;
                        }
                        break;
index 32e52d1ca758d654335550fc08d3cc0b2fb5674f..defc1932d34c0ecd9a17682166f0317ae890fe52 100644 (file)
@@ -734,7 +734,7 @@ int ldif_is_not_printable(
                ber_len_t i;
 
                for ( i = 0; val[i]; i++ ) {
-                       if ( !isascii( val[i] ) || !isprint( val[i] ) ) {
+                       if ( !isascii( val[i] ) || !isprint( (unsigned char) val[i] ) ) {
                                return 1;
                        }
                }
@@ -858,7 +858,7 @@ ldif_read_record(
                                                }
 
                                                ptr = line + STRLENOF("include:");
-                                               while (isspace(*ptr)) ptr++;
+                                               while (isspace((unsigned char) *ptr)) ptr++;
                                                fp2 = ldif_open_url( ptr );
                                                if ( fp2 ) {
                                                        LDIFFP *lnew = ber_memalloc( sizeof( LDIFFP ));
index 77baee98c65b847caf69e2bff2dc641df84f1fd5..cb92e59f247fe9bf229bd00db4ff153a543c0e54 100644 (file)
@@ -207,7 +207,7 @@ int lutil_parsetime( char *atm, struct lutil_tm *tm )
                unsigned i, fracs;
 
                /* Is the stamp reasonably long? */
-               for (i=0; isdigit(atm[i]); i++);
+               for (i=0; isdigit((unsigned char) atm[i]); i++);
                if (i < sizeof("00000101000000")-1)
                        break;
 
@@ -247,7 +247,7 @@ int lutil_parsetime( char *atm, struct lutil_tm *tm )
                if (tm->tm_sec < 0 || tm->tm_sec > 61) break;
 
                /* Fractions of seconds */
-               for (i = 0, fracs = 0;isdigit(*ptr);) {
+               for (i = 0, fracs = 0; isdigit((unsigned char) *ptr); ) {
                        i*=10; i+= *ptr++ - '0';
                        fracs++;
                }
index 230dcdace2f6dfcf1c27abddd441cd70df1c1119..96d8e4a88ca540ed533b95b74ce11376ad2378d8 100644 (file)
@@ -994,7 +994,7 @@ parse_acl(
                                                                < bdn->a_pat.bv_len;
                                                        exp = strchr( exp, '$' ) )
                                                {
-                                                       if ( isdigit( exp[ 1 ] ) ) {
+                                                       if ( isdigit( (unsigned char) exp[ 1 ] ) ) {
                                                                gotit = 1;
                                                                break;
                                                        }
index dd7feee8d14c8f849e90560a528e3c33ff671599..34530f38f2f08043856ecfb80ea8001b2ca5761e 100644 (file)
@@ -490,7 +490,7 @@ bdb_cf_gen(ConfigArgs *c)
                                struct berval bv, def = BER_BVC("default");
                                char *ptr;
 
-                               for (ptr = c->line; !isspace( *ptr ); ptr++);
+                               for (ptr = c->line; !isspace( (unsigned char) *ptr ); ptr++);
 
                                bv.bv_val = c->line;
                                bv.bv_len = ptr - bv.bv_val;
@@ -578,8 +578,8 @@ bdb_cf_gen(ConfigArgs *c)
 
                if ( c->op == SLAP_CONFIG_ADD ) {
                        ptr += STRLENOF("dbconfig");
-                       while (!isspace(*ptr)) ptr++;
-                       while (isspace(*ptr)) ptr++;
+                       while (!isspace((unsigned char)*ptr)) ptr++;
+                       while (isspace((unsigned char)*ptr)) ptr++;
                }
 
                if ( bdb->bi_flags & BDB_IS_OPEN ) {
index a00d820b64f6c0ae153eaec865b4fa7852a978de..3bda48fbead52dee17da9f8fdad5cfdef0eccba1 100644 (file)
@@ -353,7 +353,7 @@ ldap_back_cf_gen( ConfigArgs *c )
 
                        bindconf_unparse( &li->li_acl, &bv );
 
-                       for ( i = 0; isspace( bv.bv_val[ i ] ); i++ )
+                       for ( i = 0; isspace( (unsigned char) bv.bv_val[ i ] ); i++ )
                                /* count spaces */ ;
 
                        if ( i ) {
@@ -488,7 +488,7 @@ ldap_back_cf_gen( ConfigArgs *c )
                                bv.bv_len = ptr - bv.bv_val;
 
                        } else {
-                               for ( i = 0; isspace( bc.bv_val[ i ] ); i++ )
+                               for ( i = 0; isspace( (unsigned char) bc.bv_val[ i ] ); i++ )
                                        /* count spaces */ ;
 
                                if ( i ) {
@@ -547,7 +547,7 @@ ldap_back_cf_gen( ConfigArgs *c )
                                return 1;
                        }
 
-                       for ( i = 0; isspace( bv.bv_val[ i ] ); i++ )
+                       for ( i = 0; isspace( (unsigned char) bv.bv_val[ i ] ); i++ )
                                /* count spaces */ ;
 
                        if ( i ) {
@@ -1157,7 +1157,7 @@ done_url:;
 
        case LDAP_BACK_CFG_TIMEOUT:
                for ( i = 1; i < c->argc; i++ ) {
-                       if ( isdigit( c->argv[ i ][ 0 ] ) ) {
+                       if ( isdigit( (unsigned char) c->argv[ i ][ 0 ] ) ) {
                                int             j;
                                unsigned        u;
 
index 69c2da66644df2aef4c935615523139830a13c6f..b390fc990f366ef7c619edd93eaacbb330512631 100644 (file)
@@ -851,7 +851,7 @@ config_generic(ConfigArgs *c) {
                                AC_MEMCPY( abv.bv_val, ibuf, abv.bv_len );
                                /* Turn TAB / EOL into plain space */
                                for (src=bv.bv_val,dst=abv.bv_val+abv.bv_len; *src; src++) {
-                                       if (isspace(*src)) *dst++ = ' ';
+                                       if (isspace((unsigned char)*src)) *dst++ = ' ';
                                        else *dst++ = *src;
                                }
                                *dst = '\0';
@@ -1416,8 +1416,8 @@ config_generic(ConfigArgs *c) {
                                char *ptr;
                                if ( c->op == SLAP_CONFIG_ADD ) {
                                        ptr = c->line + STRLENOF("moduleload");
-                                       while (!isspace(*ptr)) ptr++;
-                                       while (isspace(*ptr)) ptr++;
+                                       while (!isspace((unsigned char) *ptr)) ptr++;
+                                       while (isspace((unsigned char) *ptr)) ptr++;
                                } else {
                                        ptr = c->line;
                                }
@@ -2305,7 +2305,7 @@ config_loglevel(ConfigArgs *c) {
        for( i=1; i < c->argc; i++ ) {
                int     level;
 
-               if ( isdigit( c->argv[i][0] ) || c->argv[i][0] == '-' ) {
+               if ( isdigit((unsigned char)c->argv[i][0]) || c->argv[i][0] == '-' ) {
                        if( lutil_atoi( &level, c->argv[i] ) != 0 ) {
                                snprintf( c->msg, sizeof( c->msg ), "<%s> unable to parse level", c->argv[0] );
                                Debug( LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
index 8e8558c053b72ea06e576859d2f3cc1757409e48..2598291bc5ab157f48c2e1d71a7f583b00a54dbe 100644 (file)
@@ -552,7 +552,7 @@ strtok_quote_ldif( char **line )
        if ( !ptr || !*ptr )
                return NULL;
 
-       while( isspace( *ptr )) ptr++;
+       while( isspace( (unsigned char) *ptr )) ptr++;
 
        if ( *ptr == '"' ) {
                inquote = 1;
@@ -563,7 +563,7 @@ strtok_quote_ldif( char **line )
 
        for (;*ptr;ptr++) {
                if ( *ptr == '"' ) {
-                       if ( inquote && ( !ptr[1] || isspace(ptr[1]))) {
+                       if ( inquote && ( !ptr[1] || isspace((unsigned char) ptr[1]))) {
                                *ptr++ = '\0';
                                break;
                        }
@@ -573,7 +573,7 @@ strtok_quote_ldif( char **line )
                }
                if ( inquote )
                        continue;
-               if ( isspace( *ptr )) {
+               if ( isspace( (unsigned char) *ptr )) {
                        *ptr++ = '\0';
                        break;
                }
@@ -587,7 +587,7 @@ strtok_quote_ldif( char **line )
        if ( !*ptr ) {
                *line = NULL;
        } else {
-               while ( isspace( *ptr )) ptr++;
+               while ( isspace( (unsigned char) *ptr )) ptr++;
                *line = ptr;
        }
        return beg;
index 46d24ba1dbf8dad8bbddfa0935938832cfba694b..119e24a9554d70cc8f1514a6e2fb5bd7b4804c8f 100644 (file)
@@ -244,7 +244,7 @@ parse_debug_level( const char *arg, int *levelp, char ***unknowns )
 {
        int     level;
 
-       if ( arg != NULL && arg[ 0 ] != '-' && !isdigit( arg[ 0 ] ) )
+       if ( arg && arg[ 0 ] != '-' && !isdigit( (unsigned char) arg[ 0 ] ) )
        {
                int     i;
                char    **levels;