]> git.sur5r.net Git - openldap/commitdiff
Apply Hallvard's ctype 'unsigned char' fix from -devel.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 2 Mar 1999 19:30:02 +0000 (19:30 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 2 Mar 1999 19:30:02 +0000 (19:30 +0000)
50 files changed:
CHANGES
clients/fax500/main.c
clients/fax500/rp500.c
clients/finger/main.c
clients/gopher/go500.c
clients/gopher/go500gw.c
clients/mail500/main.c
clients/rcpt500/main.c
clients/rcpt500/query.c
clients/tools/ldapmodify.c
clients/ud/auth.c
clients/ud/edit.c
clients/ud/group.c
clients/ud/main.c
clients/ud/mod.c
clients/ud/print.c
clients/ud/ud.h
clients/ud/util.c
contrib/saucer/main.c
contrib/whois++/command.c
contrib/whois++/output.c
contrib/whois++/util.c
libraries/libldap/dsparse.c
libraries/libldap/getdn.c
libraries/libldap/getdxbyname.c
libraries/libldap/getfilter.c
libraries/libldap/init.c
libraries/libldap/search.c
libraries/libldap/tmplout.c
libraries/libldif/line64.c
servers/ldapd/syntax.c
servers/slapd/aclparse.c
servers/slapd/attr.c
servers/slapd/config.c
servers/slapd/daemon.c
servers/slapd/dn.c
servers/slapd/entry.c
servers/slapd/phonetic.c
servers/slapd/repl.c
servers/slapd/shell-backends/shellutil.c
servers/slapd/str2filter.c
servers/slapd/tools/chlog2replog.c
servers/slapd/tools/edb2ldif.c
servers/slapd/tools/ldapsyntax.c
servers/slapd/tools/ldbmcat.c
servers/slapd/tools/ldbmtest.c
servers/slapd/tools/ldif2id2children.c
servers/slapd/tools/ldif2id2entry.c
servers/slapd/tools/ldif2index.c
servers/slapd/value.c

diff --git a/CHANGES b/CHANGES
index d34f48a614ea2ede9675980dab088dad4cbdd003..b7bb8a6a280ebfffe3880529c3d138c03121cefd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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.
 
index 2c103c20a8596fefab2da2a534164e886a6506f3..5c4429e40ef72351db2c16f83039ef5e96d8addf 100644 (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;
                                        }
index abf4daad898564eaf89bce8145e8eaa84a34bf59..dafb4a4a20783b2c7080e076091efa1b5c2d8ee0 100644 (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;
                                        }
index 0b3f6b2d8487c116d1ea4444700649afafab0967..ccc689852f35135185117df904436f85f4435a5a 100644 (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;
                                        }
index 60b35b913cb961c5f99015dec316c86e0e97627c..823589951e292867a3c9c931005b95ea9dc6d7f8 100644 (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;
        }
index 04ad52ea126d419f9339cf92a482a71dda0b82ca..7eee0e696e8a0f3909adfa59d3428a72efe26358 100644 (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;
        }
index aedd5594d3809ac8be122fbad255df48b0f0e4be..f99747d5e8aa24acb003a25e6a0dcd7c2ffd1dda 100644 (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;
                                        }
index 2ea4d740f28604ebe8824dee664e4825ce5ddc61..449c1b8a5ac252ae0066a6898c65b6d714632f5c 100644 (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 );
index 28605e9a259465e7e7bce6d8912908ec43b80211..5b38049c917d0892a05f4130231ab16cee0db550 100644 (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';
index 97543c3a0b5a5056e734c42cd707d9877396d27d..d63e887981df1cdfc979da28e9603cf2ea34d7c9 100644 (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' ) {
index 0461261f2bd98b030445c11c7e2eb36b8838e6b4..3c6d81ff33a03aa9d7f6929faa17fea10e784a4c 100644 (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 );
index 891f2e7c87c3b09247f509888ef26348fa7bb022..8bdab14f9d77ed19583c56e3a314109806073b82 100644 (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
index 9e32739f24ca762a578715370698409450e89baf..b864eb97774691c0e199f7d9a90019b78c6135c0 100644 (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;
index 2178c5685c187fd2f71358077ef8dc3065f0b9bc..9480c63b7dc2f36735d32166fe3cae7abc75638b 100644 (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;
index b6efc6fc02c7dc275d455fdaf397efb9a306648a..9ead3ba2783a7d7cccad5813c91bc66ffcbc3b89 100644 (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*/
        }
index ad62c50a4cf2096fbdce2bd9cd96391d9da94413..c369e5ee727870755341bbbde18ec30a9b1e4440 100644 (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 );
        }
     }
index ab893e3a2561191c5766acd9fa273519de1dde65..a90765f6e8c6d8f7e14c9b3b6c29a9aab88e2291 100644 (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) == '_'))
 
 /*
index ae1072f29a0993cb2ddefb80af779135e8dc0387..0ee2e609269cbe54d65319dd0155ea2a34ad300b 100644 (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);
index b664c5a10fb9316467b632ca38b0c313d73c0602..3e21106953481c5b79c977b423db1d525b43aad3 100644 (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;
index 1b109ae65c7a4a132091b0a5135d8a91dacb6b89..638442e897c180cd51a09280d0968c022eb29427 100644 (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 );
index 6ebe649227c74c6bd23e1c3d8d64675f1f609b45..b793971e62399c69bd622f208bcdac738e50762b 100644 (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
index 5d7b8ebec48deb18763de080fb6e45fc72c6d6e0..3f9bdd668b0f6afe51e7940655b2a50aab87ae88 100644 (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;
 }
 
index 13451a4de102f12f38e511caa355c338f936e1fd..51403c40f2eb6db06d03e96a0ed86b1a3b66ab35 100644 (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;
            }
index 2291a121db96942d0db505b24c19482f7ffdac34..b56eb6e56b75fea46ed525d869610f1f49d73156 100644 (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++;
 
index f48a3269bb61d79c93d0a7f991122be98cfcca64..bce6361027079ace0af4e08f5b65356ad35969d9 100644 (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;
                    }
index 4d201e89a97ab70c3e734dec73916a090393ff73..6851a0c7c52f73377880c5f215bdb962de80f1c9 100644 (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 ) {
index cc8588d712a138b36c83c8056a9b137746731d77..b3a2e93c634a6940881c5e556160cc5a4b95f0a2 100644 (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++) {
index 794831fc9a24be76b99a0d3c26b131bf8fe803e6..bec117c85b280f11117b994cfa9667c2b76e371b 100644 (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;
index fad65f766fafbb2baf15f2255081419b6aa4b0c9..f40c343c52be4ebdb3b5e02a3bdf40a313180c82 100644 (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 */
     }
 
index 9036d7d124f0adf7607ff1fd2bd27bd10a544ffb..09aa3433fcc349935801a74db46d6d71ba26600c 100644 (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;
index 9b9ee0febce8025b0c51c77190597cfcacb22fda..609158a4c0df4f49536923952cc27b11ff1c1291 100644 (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 ) {
index d0de1d1d436b79530e574459ec2afff043cdf3f5..d3cf307e35e92a81af595928a8706439423953c3 100644 (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);
index 0d696dc02486058b66e229ebe802f936dbba74b9..6467a13f05ecc54b146e7fb0763185504e8adbe6 100644 (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 );
index b810460680585fa12a89373d58802fb0e162d673..69fa445694fef8d9848cfcbfea54f2c49172b8fa 100644 (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 );
                }
 
index d5a9410a6dbdf9aee93872793493d6a2b72ece6e..89af5ec78b14d59dfcf77152fcfe999301bd94aa 100644 (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 {
index 54e53bfc35e12bd865b07791d5b0594221c27486..70863dc6d9529f3832f392234f9b484965bbbccd 100644 (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 );
index 7572686781b69c5f845f47052669274b0b225223..2399274e3d13aa3901bcf9086cfb5e60278c6b5f 100644 (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,
index 4c7f3537bf57717da9ae0967652562dad582f8f0..27f3f91e546208639f37a9e079622147bf033cf5 100644 (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';
index e8fddf337bbbecbf6b35d29170a06d70a0260cdc..139934834bd6aed18c75225d9d40ce07b8257912 100644 (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 );
index 59d43cb7073fe07c7d17ff9a17c421d4bd3780d9..8fb7ddea44e30a4dbf66d34087b78797b34f0e34 100644 (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;
index 1ab28f146278a4c604cb7f8a247991bf286685d9..3fce185f77bd49a5f5953d651ad08b04c91702d7 100644 (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;
index b9d171ba8e16bd2c5a8a6888e30d2f249826307c..434977991494cfc8a7ca970f9e33992d978f4b47 100644 (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 );
index 9aad796369a0c46b5f58f5f5395296c5877a19e1..bef4a0d8c785662ea0906c5cd1559043f9e23ec6 100644 (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';
        }
 
index 2495e4db22d6dab7eda7c13e1f9e794b4a07b2ea..2d916e254dfde1e67ab39d3c13ea21e65b9d77b0 100644 (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 ) {
index f7e62c7d315b85000fad7a5f7ddf63fde67a1631..fb3cbdd1372cb013ebbb1b690d2037b8f0ddf27e 100644 (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;
                         }
index afdd148ee0c6b9222c7d7da4c66be390faa58511..c46a3c9e9f86ea7b46c64958a781c0ac38594c34 100644 (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 {
index da966c2a8fd6d3e78720b4bac55900f2c88d74b8..1dab807cd10943bc1d5ff0f04b590c77b54841c2 100644 (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++;
index 96ed84ffe3c34e1e4cf8ba25db158c9c748cb06f..1ab1a2d6811e8f9d3f70a2d5c46c603b02afa421 100644 (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 {
index 2b39bca046375342a7c3c2784e61f299cca56260..82ca056e90a3aa6837dadc7aada1281a7d278339 100644 (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++;
index bb6b7e620b62c13648992eaa592e1af27dd349cc..d8f72c4cd85a660e9644634d2d013630ed259c6c 100644 (file)
@@ -98,7 +98,7 @@ value_normalize(
                if ( (syntax & SYNTAX_TEL) && (*s == ' ' || *s == '-') ) {
                        continue;
                }
-               *d++ = TOUPPER( *s );
+               *d++ = TOUPPER( (unsigned char) *s );
        }
        *d = '\0';
 }