]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Convert argument of to_lower() and is_digit() to unsigned char
authorWillem Toorop <willem@nlnetlabs.nl>
Wed, 24 Jul 2019 13:30:11 +0000 (09:30 -0400)
committerWillem Toorop <willem@nlnetlabs.nl>
Wed, 24 Jul 2019 13:30:11 +0000 (09:30 -0400)
examples/ldns-dpa.c
examples/ldns-signzone.c
str2host.c

index 1f080e6d53fcc97c90f2dcc44dd97cd0034b0a51..46d8f9ad7baa735fd339fe25617a12326b6528fd 100644 (file)
@@ -987,10 +987,10 @@ match_str(type_operator operator,
                valuedup = strdup(value);
                mvaluedup = strdup(mvalue);
                for (i = 0; i < strlen(valuedup); i++) {
-                       valuedup[i] = tolower(valuedup[i]);
+                       valuedup[i] = tolower((unsigned char)valuedup[i]);
                }
                for (i = 0; i < strlen(mvaluedup); i++) {
-                       mvaluedup[i] = tolower(mvaluedup[i]);
+                       mvaluedup[i] = tolower((unsigned char)mvaluedup[i]);
                }
                result = strstr(valuedup, mvaluedup) != 0;
                free(valuedup);
index c08c98d58396f23388a17b0f6752909286aab755..1a5678c5677bb0f836afd1b9d86b82c6b26bc645 100644 (file)
@@ -336,7 +336,7 @@ parse_algspec ( const char * const p )
        if ( p == NULL )
                return 0;
 
-       if ( isdigit ( *p ) ) {
+       if ( isdigit ( (const unsigned char)*p ) ) {
                const char *nptr = NULL;
                const long id = strtol ( p, (char **) &nptr, 10 );
                return id > 0 && nptr != NULL && *nptr == ',' ? id : 0;
index 435ad1a4343585b841ded35062959cfece48a930..0bf62d106e9cbe79dd5f4bfb0d09959ca473d743 100644 (file)
@@ -1121,7 +1121,7 @@ ldns_str2rdf_wks(ldns_rdf **rd, const char *str)
                        proto_str = strdup(token);
                        lc_proto_str = strdup(token);
                        for (c = lc_proto_str; *c; c++) {
-                               *c = tolower(*c);
+                               *c = tolower((unsigned char)*c);
                        }
                        if (!proto_str || !lc_proto_str) {
                                free(proto_str);
@@ -1138,7 +1138,7 @@ ldns_str2rdf_wks(ldns_rdf **rd, const char *str)
                        }
                        if (!serv && (lc_token = strdup(token))) {
                                for (c = lc_token; *c; c++) {
-                                       *c = tolower(*c);
+                                       *c = tolower((unsigned char)*c);
                                }
                                serv = getservbyname(lc_token, proto_str);
                                if (!serv) {