Change a bunch of calls to ctype macros (those cited by Jeff, and a
authorKen Raeburn <raeburn@mit.edu>
Fri, 16 Jun 2006 06:58:42 +0000 (06:58 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 16 Jun 2006 06:58:42 +0000 (06:58 +0000)
few others) to cast the character values to unsigned char.

ticket: 3445

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18156 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ftp/cmds.c
src/appl/telnet/telnet/telnet.c
src/lib/kadm5/srv/server_acl.c
src/lib/kadm5/srv/server_misc.c
src/lib/krb4/kparse.c
src/lib/krb5/ccache/ccbase.c
src/lib/krb5/keytab/ktbase.c
src/lib/krb5/krb/conv_princ.c
src/lib/krb5/os/hst_realm.c
src/lib/krb5/os/sn2princ.c
src/tests/asn.1/utility.c

index b9cb2a2a2cb8016daefe9476f558182b95c31ce7..3d851937b9031c27ef518bc16c79911fa9efa5b2 100644 (file)
@@ -725,14 +725,14 @@ void mput(argc, argv)
                        if (mflag && confirm(argv[0], cp)) {
                                tp = cp;
                                if (mcase) {
-                                       while (*tp && !islower((int) (*tp))) {
+                                       while (*tp && !islower((unsigned char) (*tp))) {
                                                tp++;
                                        }
                                        if (!*tp) {
                                                tp = cp;
                                                tp2 = tmpbuf;
                                                while ((*tp2 = *tp) != 0) {
-                                                    if (isupper((int) *tp2)) {
+                                                    if (isupper((unsigned char) *tp2)) {
                                                        *tp2 = 'a' + *tp2 - 'A';
                                                     }
                                                     tp++;
@@ -864,14 +864,14 @@ usage:
        if (loc && mcase) {
                char *tp = argv[1], *tp2, tmpbuf[MAXPATHLEN];
 
-               while (*tp && !islower((int) *tp)) {
+               while (*tp && !islower((unsigned char) *tp)) {
                        tp++;
                }
                if (!*tp) {
                        tp = argv[2];
                        tp2 = tmpbuf;
                        while ((*tp2 = *tp) != 0) {
-                               if (isupper((int) *tp2)) {
+                               if (isupper((unsigned char) *tp2)) {
                                        *tp2 = 'a' + *tp2 - 'A';
                                }
                                tp++;
@@ -994,14 +994,14 @@ void mget(argc, argv)
                if (mflag && confirm(argv[0], cp)) {
                        tp = cp;
                        if (mcase) {
-                               while (*tp && !islower((int) *tp)) {
+                               while (*tp && !islower((unsigned char) *tp)) {
                                        tp++;
                                }
                                if (!*tp) {
                                        tp = cp;
                                        tp2 = tmpbuf;
                                        while ((*tp2 = *tp) != 0) {
-                                               if (isupper((int) *tp2)) {
+                                               if (isupper((unsigned char) *tp2)) {
                                                        *tp2 = 'a' + *tp2 - 'A';
                                                }
                                                tp++;
index 6215fc1e9bd26dce1c4a4952af656024050d2351..a44df7ab53e0a1dbefbc1cfdc30d51e1206cb204 100644 (file)
@@ -717,8 +717,8 @@ mklist(buf, name)
                 */
                if ((c == ' ') || !isascii(c))
                        n = 1;
-               else if (islower((int) c))
-                       *cp = toupper((int) c);
+               else if (islower((unsigned char) c))
+                       *cp = toupper((unsigned char) c);
        }
        
        /*
index fa63027f7cbfacba975385d3058ab7db1c842d34..6d8d6d7f69760b876eab154be1ca92e016049ff7 100644 (file)
@@ -197,7 +197,7 @@ kadm5int_acl_parse_line(lp)
            for (op=acle_ops; *op; op++) {
                char rop;
 
-               rop = (isupper((int) *op)) ? tolower((int) *op) : *op;
+               rop = (isupper((unsigned char) *op)) ? tolower((unsigned char) *op) : *op;
                found = 0;
                for (t=0; acl_op_table[t].ao_op; t++) {
                    if (rop == acl_op_table[t].ao_op) {
index fa4e62ee4310b8687df3b936500c336de4ed0d65..cd65371c9c9f633f523f29d20261766a39a3774b 100644 (file)
@@ -134,17 +134,17 @@ passwd_check(kadm5_server_handle_t handle,
            return KADM5_PASS_Q_TOOSHORT;
        s = password;
        while ((c = *s++)) {
-           if (islower((int) c)) {
+           if (islower((unsigned char) c)) {
                nlower = 1;
                continue;
            }
-           else if (isupper((int) c)) {
+           else if (isupper((unsigned char) c)) {
                nupper = 1;
                continue;
-           } else if (isdigit((int) c)) {
+           } else if (isdigit((unsigned char) c)) {
                ndigit = 1;
                continue;
-           } else if (ispunct((int) c)) {
+           } else if (ispunct((unsigned char) c)) {
                npunct = 1;
                continue;
            } else {
index 190518ad918d4081cccf22a0b8933c544403f702..f6607a9cad708f891beceab16d66bb3038e085a1 100644 (file)
@@ -563,8 +563,8 @@ static char * strutol( start )
 {
     char *q;
     for (q=start; *q; q++)
-        if (isupper((int) *q))
-           *q=tolower((int) *q);
+        if (isupper((unsigned char) *q))
+           *q=tolower((unsigned char) *q);
     return(start);
 }
 \f
index 2b15ff6f32bdbdf99470a76e7a34eb8281fbe497..df63e259d4cf3278b43a3c366fe04e3acb2c6186 100644 (file)
@@ -151,7 +151,7 @@ krb5_cc_resolve (krb5_context context, const char *name, krb5_ccache *cache)
 
     pfxlen = cp - name;
 
-    if ( pfxlen == 1 && isalpha(name[0]) ) {
+    if ( pfxlen == 1 && isalpha((unsigned char) name[0]) ) {
         /* We found a drive letter not a prefix - use FILE: */
         pfx = strdup("FILE:");
         if (!pfx)
index e633c0c3a76debb7830602c57ddd9d07b47b81c6..8374e65468b6bd275d0cdec6b10690a69dd3bff9 100644 (file)
@@ -131,7 +131,7 @@ krb5_kt_resolve (krb5_context context, const char *name, krb5_keytab *ktid)
 
     pfxlen = cp - name;
 
-    if ( pfxlen == 1 && isalpha(name[0]) ) {
+    if ( pfxlen == 1 && isalpha((unsigned char) name[0]) ) {
         /* We found a drive letter not a prefix - use FILE: */
         pfx = strdup("FILE:");
         if (!pfx)
index 885dc995adc0a26e805a6fc3c0b60bdf82977f33..67768835f2f5411c9d73c2fd01a1bb3a14651e51 100644 (file)
@@ -329,8 +329,8 @@ krb5_425_conv_principal(krb5_context context, const char *name, const char *inst
                      return retval;
                  if (domain) {
                      for (cp = domain; *cp; cp++)
-                         if (isupper((int) (*cp)))
-                             *cp = tolower((int) *cp);
+                         if (isupper((unsigned char) (*cp)))
+                             *cp = tolower((unsigned char) *cp);
                      strncat(buf, ".", sizeof(buf) - 1 - strlen(buf));
                      strncat(buf, domain, sizeof(buf) - 1 - strlen(buf));
                      krb5_xfree(domain);
index b5c8f66ff492860291ac627136ab713afce0bd1f..17b1e42c492350bf3828fa089a90cd5015e9bf67 100644 (file)
@@ -235,8 +235,8 @@ krb5_get_host_realm(krb5_context context, const char *host, char ***realmsp)
     }
 
     for (cp = local_host; *cp; cp++) {
-       if (isupper((int) (*cp)))
-           *cp = tolower((int) *cp);
+       if (isupper((unsigned char) (*cp)))
+           *cp = tolower((unsigned char) *cp);
     }
     l = strlen(local_host);
     /* strip off trailing dot */
@@ -318,8 +318,8 @@ krb5_get_host_realm(krb5_context context, const char *host, char ***realmsp)
 
             /* Assume the realm name is upper case */
             for (cp = realm; *cp; cp++)
-                if (islower((int) (*cp)))
-                    *cp = toupper((int) *cp);
+                if (islower((unsigned char) (*cp)))
+                    *cp = toupper((unsigned char) *cp);
         } else {    
             /* We are defaulting to the local realm */
             retval = krb5_get_default_realm(context, &realm);
index 65678c8294b573d06a95fa814dcc4d40f84bc589..2ba7e8ae2a351e5f1b231e8a49c6e4315a39876f 100644 (file)
@@ -148,8 +148,8 @@ krb5_sname_to_principal(krb5_context context, const char *hostname, const char *
 
        if (type == KRB5_NT_SRV_HST)
            for (cp = remote_host; *cp; cp++)
-               if (isupper((int) (*cp)))
-                   *cp = tolower((int) (*cp));
+               if (isupper((unsigned char) (*cp)))
+                   *cp = tolower((unsigned char) (*cp));
 
        /*
         * Windows NT5's broken resolver gratuitously tacks on a
index 660161fa19b3a7d25d12ba64e3419da8544e309f..6ad2e9de857bea2eb1a28c021c5ea7f881337080 100644 (file)
@@ -77,9 +77,9 @@ krb5_error_code krb5_data_hex_parse(krb5_data *d, const char *s)
     for (lo = 0, dp = d->data, cp = s; *cp; cp++) {
        if (*cp < 0)
            return ASN1_PARSE_ERROR;
-       else if (isspace(*cp))
+       else if (isspace((unsigned char) *cp))
            continue;
-       else if (isxdigit(*cp)) {
+       else if (isxdigit((unsigned char) *cp)) {
            buf[0] = *cp;
            v = strtol(buf, NULL, 16);
        } else